Nicolas
Nicolas

Reputation: 2281

get threejs scene and camera orientation to set default view

I want to create a THREE.JS demo but I am having troubles settings the default camera position/orientation as I want it to be.

I want to set the view/scene/camera manually using a trackball interaction then "reverse engineer" it to set the right camera position/orientation/etc. and whatever needs to be set to set the chosen view as a default.

I played around with the camera quaternion without success. I would imagine I just have to get the camera position/quaternion from my scene and use it as default settings, right?

Best,

Upvotes: 1

Views: 861

Answers (1)

bjorke
bjorke

Reputation: 3305

That is correct -- alternatively, you could use "lookAt" and define the camera by a position and a target to view.

If you are using an extra layer of control -- say, a THREE OrbitController -- when defining your view, then you will want to lock the values of the control, not the camera.

Upvotes: 1

Related Questions