Problems with rotations with OpenGL and GLUT

This is a discussion on Problems with rotations with OpenGL and GLUT within the Game Programming forums, part of the General Programming Boards category; what i want to do, is to rotate the polygon, but it seems it doesn't work if I make these ...

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    35

    Problems with rotations with OpenGL and GLUT

    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
    Attached Files Attached Files

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    exactly what happens?
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    Registered User
    Join Date
    Jun 2002
    Posts
    35
    I think you can better understand if you run the program

    if you prefer I can put online the exe

  4. #4
    Registered User red_baron's Avatar
    Join Date
    May 2002
    Posts
    274
    put up exe i dont think everyone can compile your code
    ¿Red Baron?

    "Imagination is more important than knowledge"
    -Albert Einstein (1879-1955)

    Check out my games!

    [code] /* dont forget code tags! */ [/code]

  5. #5
    Registered User
    Join Date
    Jun 2002
    Posts
    35
    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
    Attached Files Attached Files

  6. #6
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    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/doc...dlls37beta.zip
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  7. #7
    Registered User
    Join Date
    Jun 2002
    Posts
    35
    here is the glut32.dll
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    Jun 2002
    Posts
    35
    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

  9. #9
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    try this instead and see if thats more what you want?
    Attached Files Attached Files
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  10. #10
    Registered User
    Join Date
    Jun 2002
    Posts
    35
    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

  11. #11
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    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?
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  12. #12
    Registered User
    Join Date
    Jun 2002
    Posts
    35
    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?

  13. #13
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    i really don't know if you can get the rotated vector data,
    so ask here http://www.opengl.org/discussion_boa...y/Ultimate.cgi

    they know far more than me, they might be able to help.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  14. #14
    Registered User
    Join Date
    Jun 2002
    Posts
    35
    ok, thanks anyway

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Shininess lighting GLUT OpenGL
    By Zishaan in forum Game Programming
    Replies: 1
    Last Post: 04-22-2007, 09:30 PM
  2. openGL space shooter problems
    By c_young in forum Game Programming
    Replies: 0
    Last Post: 01-17-2007, 04:33 PM
  3. openGL problems (glut)
    By c_young in forum C++ Programming
    Replies: 2
    Last Post: 01-04-2007, 01:27 PM
  4. errors with opengl & glut in windows
    By korbitz in forum Game Programming
    Replies: 12
    Last Post: 03-14-2004, 02:54 PM
  5. SDL or GLUT for Opengl?
    By drdroid in forum Game Programming
    Replies: 1
    Last Post: 07-17-2003, 02:54 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21