0

So I want to move my cameras position around in three.js, but as I move it, I want the cameras rotation to automatically update to point at the origin.

So if i have the camera set as:

 camera.position.set(25,25,25)

I would like the camera.rotation to be updated so that it is facing the world origin.

2
  • 3
    Have you tried setting camera.lookAt(0,0,0) ? Commented Feb 13, 2020 at 16:20
  • Solved my problem. Thank you so much! Commented Feb 13, 2020 at 16:35

1 Answer 1

1

You can set the camera to look at or target a specific position in your scene but using the lookAt() method - https://threejs.org/docs/#api/en/core/Object3D.lookAt

In this case, setting camera.lookAt(0,0,0) will point to the centre of the 'world'.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.