Sign in to follow this  

Reversing camera view using Yaw, Pitch, and Roll

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

Our engine gives you the camera's orientation in yaw, pitch, and roll (as ints). I am unaccustomed to using these as I've always used a normalized vector for the direction in the past. What I want to do is find the reverse of the direction of the camera (for billboarding). Can I simply negate these values to find the reverse of the camera's orientation?

Share this post


Link to post
Share on other sites
<hypothesis> Add/subtract 180 degrees (or pi, if radians) from each of Yaw/Pitch/Roll. Essentially all you're doing is making a 180-turn on each of its orientations. </hypothesis>

Untested, but it should work. :)

Share this post


Link to post
Share on other sites
At some point you must be converting your Euler angles to a matrix for interface with an API, I would imagine. If so, I would just take this matrix and construct the billboard matrix from it directly, and not deal with the Euler angles for that step at all. (Please ask if you need any clarification...)

Share this post


Link to post
Share on other sites
Subtracting 180 won't work because the numbers can be very big -- much bigger than 180. Getting at the matrix isn't an option either due to the nature of the engine and the environment (language) I'm coding in.

I'm thinking I'd probably have to convert these values to a direction, reverse it, then convert back to yaw, pitch, and roll.

Share this post


Link to post
Share on other sites
Quote:
Getting at the matrix isn't an option either due to the nature of the engine and the environment (language) I'm coding in.

I'm thinking I'd probably have to convert these values to a direction, reverse it, then convert back to yaw, pitch, and roll.


You must be missing that ONE direction isn't enough, unless your engine is limited to cameras that always have the same "up" direction. Not to mention that the required up and view direction ARE the second and third vector in a matrix with the first being the cross product, so I fail to see how you could extract the direction but not the full matrix.

Share this post


Link to post
Share on other sites

This topic is 4358 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.

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

Sign in to follow this