Skip to Content
初めてのThree.js 第2版 ―WebGLのためのJavaScript 3Dライブラリ
book

初めてのThree.js 第2版 ―WebGLのためのJavaScript 3Dライブラリ

by Jos Dirksen, あんどうやすし
July 2016
Intermediate to advanced
416 pages
6h 39m
Japanese
O'Reilly Japan, Inc.
Content preview from 初めてのThree.js 第2版 ―WebGLのためのJavaScript 3Dライブラリ

2章シーンの基本要素

前章でThree.jsの基本について学びました。いくつかのサンプルを紹介し、読者にとってはおそらく初めてである完全なThree.jsシーンを作成しました。この章ではもう少しThree.jsの詳細に踏み込み、シーンを構成する基本的なコンポーネントについて説明します。この章で説明するのは以下のようなトピックについてです。

  • Three.jsシーンで使用されるコンポーネント群
  • Three.Sceneオブジェクトを使用してできること
  • ジオメトリとメッシュの関係
  • 平行投影カメラと透視投影カメラの違い

初めにシーンを作成する方法と、そこにオブジェクトを追加する方法について説明します。

2.1 シーンの作成

前の章でTHREE.Sceneを使用したので、すでにThree.jsの基本についてはある程度知っているはずです。シーンに何かを表示するには表2-1にある3つの種類のコンポーネントが必要でした。

表2-1 シーンの表示に必要な3つのコンポーネント

コンポーネント説明
カメラシーンに何を描画するかを決定する
ライトマテリアルがどのように表示され、影を作成する時にどのように使用されるか(詳細は「3章 光源」で説明)に影響を与える
オブジェクトカメラの視点で描画される主な物体群。立方体、球など

THREE.Sceneはさまざまなオブジェクトすべてを保持するコンテナです。このオブジェクト自身のオプションや機能はそれほど多くありません。

[警告]

THREE.Sceneはシーングラフとも呼ばれることのある構造体です。シーングラフはグラフィカルなシーンの必要な情報をすべて保持している構造体です。つまりThree.jsでいうと物体、ライト、その他レンダリングに必要なオブジェクトのすべてを ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

UX戦略 第2版 ―革新的なプロダクト開発のためのテクニック

UX戦略 第2版 ―革新的なプロダクト開発のためのテクニック

Jaime Levy, 安藤 幸央, 長尾 高弘

Publisher Resources

ISBN: 9784873117706Other