Problems with rotations with OpenGL and GLUT [Archive] - C Board

PDA

View Full Version : Problems with rotations with OpenGL and GLUT


darcome
07-01-2002, 02:52 PM
what i want to do, is to rotate the polygon, but it seems it doesn't work if I make these movements:

RIGHT RIGHT RIGHT RIGHT RIGHT UP LEFT

of course, use arrow keys to move the polygon, can you tell me what's wrong??

ESC will quit the program :)

no-one
07-01-2002, 02:57 PM
exactly what happens?

darcome
07-01-2002, 03:11 PM
I think you can better understand if you run the program :)

if you prefer I can put online the exe

red_baron
07-01-2002, 03:28 PM
put up exe i dont think everyone can compile your code

darcome
07-01-2002, 03:45 PM
ok, but you need to put the glut32.dll in your windows/system or windows/system32 folder; it depends on your windows version

I can't upload the exe and the library because the zip file is too big, so I will make 2 uploads

no-one
07-01-2002, 03:46 PM
well running may be an unneccessary since a lot of the time the symptoms can be more telling, secondly i don't know excatly what it's supposed to do.


now that i've run it, i see what the problem for you is but the fact is it's doing exactly what it should... try putting the glrotate calls after the axises are draw and see if its clearer then?

when OpenGL rotates, the rotations on the axis stay so your next rotation will be based on an entirly new rotated axis.

>put up exe i dont think everyone can compile your code

you'll still need the glut installed to run it

http://www.opengl.org/developers/documentation/glut/glutdlls37beta.zip

darcome
07-01-2002, 03:47 PM
here is the glut32.dll

darcome
07-01-2002, 03:54 PM
I don't know, I'm not sure the program does what it should do, however,

There's a way to make a transformation, like a rotation, and then make the matrix I obtain, like it is the identity matrix?

Sorry but I'm not english, so I hope you understande what I mean :)

no-one
07-01-2002, 10:17 PM
try this instead and see if thats more what you want?

darcome
07-02-2002, 01:11 AM
ok, I'll try to explain what I want the program does

Of course, the polygon has to rotate on the screen, but the way it has to rotate is this:

after the polygon has rotated, I'd like to use the new polygon coordinate with the canonical axis (since I don't know if you know the word "canonical", I mean the axis created with the Identity Matrix). This way, the next rotation would be the rotation i like :P

no-one
07-02-2002, 06:08 PM
unfortunatly im not sure as to what you mean?

>I'd like to use the new polygon coordinate with the canonical axis

to what end?

or do you want to use the rotated matrix in place of the identity matrix?

darcome
07-04-2002, 12:38 PM
ok, let me see if I am able to tell you what I mean :)

From what I have understood, the rotations in OpenGL, are made rotating the axis. Because rotating the axis, the polygons are rotated too, so the coordinates of the polygon, remain the same.

There's a way to rotate the objects but not the axis? Or, there's a way that after I have rotated the axis and the polygon, using the OpenGL functions which are faster when any other routine, I suppose, I can retrieve the coordinates of the polygon like I have rotated it, instead of the axis, and use these coordinates with the Identity matrix?

no-one
07-04-2002, 09:01 PM
i really don't know if you can get the rotated vector data,
so ask here http://www.opengl.org/discussion_boards/cgi_directory/Ultimate.cgi

they know far more than me, they might be able to help.

darcome
07-05-2002, 12:12 AM
ok, thanks anyway :)