• Advertisement

Archived

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

Following camera based on euler angles

This topic is 5919 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
I suppose I mean I''m too fuddled in the head to even think of translating before I rotate. Derrr... Thanks for your help.

Share this post


Link to post
Share on other sites

  • Advertisement