LoginSignup
2

More than 5 years have passed since last update.

【three.jsのヘルパー解説集】 ⑥DirectionalLightHelperの使い方

Last updated at Posted at 2016-07-13

DirectionalLightHelper

継承:THREE.Line
解説:平行光源(DirectionalLight)を可視化してくれるヘルパーです。平行光源の向きがどちらに向いているかを確認できます。簡素なラインだけで構成されているため、ひと目で向きが解り難いことが有ります。ArrowHelperを使用したほうが分かりやすいかもしれません。

デモ

Untitled.gif

実装例

javascript
var directionalLight = new THREE.DirectionalLight(0xffff00, 0.5);
directionalLight.position.set(1, 1, 0);
scene.add(directionalLight);

var directionalLightHelper = new THREE.DirectionalLightHelper(directionalLight, 2);
directionalLight.position.set(0, 0, 0);
scnene.add(directionalLightHelper);

DirectionalLightHelper(light, size)

  • light:ヘルパーを表示させたいDirectionalLightオブジェクト
  • size:末尾についた四角形の大きさ

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2