Jump to content
  • Advertisement

Archived

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

rileyriley

Following camera based on euler angles

This topic is 6047 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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!