PDA

View Full Version : Problem with glRotatef



Aidoru
09-04-2013, 10:32 AM
Hello,
i've a problem to make a rotation around different axis:
for example if i make a rotation around Y in clw and then acw I don't have any problems,
but when i try to rotate it around X (after an y rotation) the model reset to start position (0,1,0) and then it rotate.

I know what is a rotation matrix etc...but my problem is: how can I put right direction vector in glRotatef function?

Another thing that i don't understand is that while i tried to solve this problem I added glGetFloatv(GL_MODELVIEW_MATRIX, modelViewMatrix); to get modelview matrix, but the strange thing is that the
matrix only change 2times and then it remains the same, rotation matrix and the modelview matrix after a rotation are not the same things?


Thank you

Fezziwig
09-04-2013, 12:49 PM
I suppose you could put both rotation calls into one. glRotatef(//not sure how you'd work this out probably some sining and cosining//, 1, 1, 0);