Rotate an object from my camera's direction

Hi there!



I have a simple question: How can you rotate an object from a camera’s direction? I know you can create a quaternion fromAngleNormalAxis, but my object doesn’t look at the same way as my camera when I do this.



Thank you, thecheeselover

Try Quaternion.lookAt()

1 Like

Thanks for your answer, my object rotates better but it’s always perpendicular to my camera… I’ll try to change the up vector.





#Edit:



I got it! I simply multiplied my rotation with a quaternion from angles that had an “Y” rotation of half PI.

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:math_for_dummies