0

In Three.js, is it possible to save the resulting vector when calling lookAt()? I'd like to hold onto it for re-pointing the camera later, as a sort of reset.

I looked at the code for lookAt() and saw various matrix and quaternion manipulations but am unable to figure how to pull the final vector out of it all.

larryq
  • 15,713
  • 38
  • 121
  • 190

1 Answers1

2

If you want to be able to reset the camera's orientation, just remember the camera.rotation vector, and then do something like this:

camera.rotation.copy( myRotationVector );

For info on computing the "lookAt" vector, you can refer to three.js set and read camera look vector.

Community
  • 1
  • 1
WestLangley
  • 102,557
  • 10
  • 276
  • 276