Bay 12 Games Forum
Finally... => Life Advice => Topic started by: Empty on February 24, 2009, 02:48:58 am
-
I'm programming my own c++ opengl engine (Again :P) using Vertex Buffer objects.
It uses array of vertices as input mainly. Now the problem I have is that the standard opengl rotation function glrotatef doesn't work on just plain data. So I need a formula to do the rotation math myself.
These are the data I already have.
vertex.x vertex.y vertex.z rotation.x rotation.y rotation.z and possibly if needed rotationammount.
You can assume that the rotation center is always at 0,0,0
You can assume that all of these numbers are floats.
I've looked at alot of example formulas but I have been unable myself to relate those formulas to the data I have.
So is anyone able to explain or help me with it?
-
Use quaternions for rotation and watch all your problems vanish :) I know that is not really the question you asked but it will save you a lot of hassle later on.
-
I don't understand those either.
-
Hmm then I'd suggest using a third party quaternion library and passing your data through that. It can handle various rotations and the like then you can handle the rendering in your engine.