Posted September 17, 201510 yr So Ive got a problem where I need to convert the rotationYaw and rotationPitch into the standard (x,y,z,angle) format. I tried seeing how Minecraft does this when rendering but it does the crappy trick of calling the glRotateF twice with (0,1,0,yaw) and (1,0,0,pitch). What would I need to do to convert the pitch and yaw into something like (x,y,z,angle)? Edit: Please don't ask why, Im just wondering what openGL would be doing to combine the (0,1,0,yaw) and (1,0,0,pitch) Another thing, the yaw and pitch need to be in radian format for this, not angle format like openGL uses
September 17, 201510 yr You simply can't. Since quaternion cannot represent a coordinate system, you need something with more data than that, like Matrix. In OpenGL, (0,1,0,yaw) and (1,0,0,pitch) is changed into matrix form, and multiplied. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
September 17, 201510 yr Author So your saying I would do the (0,1,0,yaw) and multiply it with (1,0,0,pitch) and that becomes the correct matrix?
September 17, 201510 yr No, you should convert them to matrix and multiply them. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.