lookAt and setTarget

Recommended Posts


It seems that the mesh has the method lookAt() but the rotation is then expressed in quaternions and euler angles remain at 0 with mesh.rotation

Although camera has the method setTarget. It does the same thing but the classic rotation is given.


I know how to manage that in my project. (With atan2 or get the rotationQuaternion angles)

But I ask : is there a reason for this difference in classes ?

Do you plan to integrate a setTarget method in meshes ?

Share this post

Link to post
Share on other sites


There is no good reason per se. You can still convert quaternions to euler if needed.

The inner goal of lookAt is to provide the right rotation and rotationQuaternion is far more easy and convenient (internally).

SetTarget was done before we added rotationQuaternion to cameras (mostly because of VR)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.