View Full Version : Convert a DirectX pitch, yaw, roll into an OpenGL rotation
How is this done? I know one uses one coord system and one uses the other, but how are these three numbers converted into the opposite system?
I am trying to use the projection matrix to do this, but it doesn't seem to do anything:
;Flip the third row of the matrix
;Set up the camera
For n=1 To countentities()
...draw your meshes...
02-01-2004, 08:09 PM
glRotatef( pitch, 1.0f, 0.0f, 0.0f );
glRotatef( yaw, 0.0f, 1.0f, 0.0f );
glRotatef( roll, 0.0f, 0.0f, 1.0f );
You may have to compensate for OpenGL using the right handed system as D3D uses the left handed system. Also why are you trying to rotate an object by setting up the rotations in the projection matrix!?
I was trying to flip something around or other. I wrote a Half-Life model viewer. The Rotations display fine in Blitz3D, but are all screwed up in OpenGL. The code should be pretty clear. Look at the render function in BlitzPlusVersion.bb: http://www.leadwerks.com/hl.zip
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.