Brandalize
Brandalize

Reputation: 21

Turn the direction of the PointLight

I'm using PointLight in my ThreeJs project. I need to make it point to the oriented direction in the image below, but I can't change it. below the code

const light = new THREE.PointLight( 0xffffff, 0.01, 40 );
light.position.set( 0, 0, 30 ); 
//light.rotateY(270); did not work
light.castShadow = true; 
scene.add( light );

Image

Upvotes: 1

Views: 465

Answers (1)

M -
M -

Reputation: 28472

PointLight doesn't really have a rotation. It acts as a source of light emanating from a single point, and it shines equally in all directions. Think of it as a star, no matter which way it rotates, it still shines in all directions.

If you need a light that does respond to rotation, you might want to consider a SpotLight or a DirectionalLight. See the image below for a visual representation:

enter image description here

Upvotes: 2

Related Questions