#### Archived

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

# Pitch is isn't going directly up

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

## Recommended Posts

Subtract the vector then normalize it: D3DXVec3Subtract(&vDiff, &vPos, &vDest ); D3DXVec3Normalize(&vTempDiff, &vDiff); fRoll = sin((double)vTempDiff.z); fPitch = sin((double)vTempDiff.y); fYaw = sin((double)vTempDiff.x); y is heading up the values are fRoll = 0.0 fPitch = -.84 fYaw = 0.0 so when I apply yaw pitch and roll its forcing the z to be positively incremented. Is this true or is there an error in my yaw, pitch, and roll calculations. I would think they could be isolated? Nick

##### Share on other sites
This is by no means supposed to answer your question, but aren''t yaw, pitch and roll relative to the orientation of the object?

##### Share on other sites
yeah it sets the orientation.

But for some reason x and z work find but Y flips out

##### Share on other sites
quote:
Original post by uber_n00b
This is by no means supposed to answer your question, but aren''t yaw, pitch and roll relative to the orientation of the object?

Yaw, pitch, and roll themselves describe orientation They''re relative to a base direction, usually one of the principle axis (ex. 0,0,1 or 1,0,0).

If your pitch is -0.84 (and yaw and roll are 0), then using DirectX coordinates and the principle direction 0,0,1 your object should experience an increasing z and decreasing y when moved in that direction.

I can''t say if there''s any error in the pitch calculation because I don''t know what the differential vector is. If there is a non-zero y value, then there will be non-zero pitch.

##### Share on other sites
yeah and thinking about it .84 is probably like 80 degrees so of course there would be an increment. I need to check my math.

##### Share on other sites
God I hate yaw, pitch, and roll. I wish they would die.

1. 1
Rutin
38
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633350
• Total Posts
3011470
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!