Archived

This topic is now archived and is closed to further replies.

rileyriley

Following camera based on euler angles

Recommended Posts

I have an object that has a position, and a rotation stored in euler angles around the x, y, and z axes. What I''d like to do is have the camera stick 5 units behind the object, in a direction opposite to the rotation. It may just be late, but I can''t seem to work out the math for this.. any help? Thanks -riley

Share this post


Link to post
Share on other sites
Just take a vector of (0, 0, -5), assuming Z is facing forward, and rotate that by your angles. Then add that to the object position.
Or do you mean you''ve forgotten how to rotate a vector?

Share this post


Link to post
Share on other sites