# Reversing camera view using Yaw, Pitch, and Roll

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

## 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 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 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 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 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.

1. 1
2. 2
3. 3
Rutin
17
4. 4
5. 5

• 14
• 9
• 10
• 12
• 17
• ### Forum Statistics

• Total Topics
632906
• Total Posts
3009155
• ### Who's Online (See full list)

There are no registered users currently online

×