Pitch is isn't going directly up

Started by
4 comments, last by nick5454 19 years, 10 months ago
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
Advertisement
This is by no means supposed to answer your question, but aren''t yaw, pitch and roll relative to the orientation of the object?
My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.
yeah it sets the orientation.

But for some reason x and z work find but Y flips out
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.
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.
God I hate yaw, pitch, and roll. I wish they would die.

This topic is closed to new replies.

Advertisement