Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 8 of 8

Thread: Rotation in 3D

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2005
    Posts
    4

    Rotation in 3D

    Can anyone tell me how I can rotate in 3D such that when I rotate in each of the x,y,z,axis, the object rotates about the original axis rather than the rotated axis.

    I am uisng the code

    glrotatef xangle,1,0,0
    glrotatef yangle,0,1,0
    glrotatef zangle,0,0,1

    Draw object

    Only rotation about the z-axis works because presumably it is the first rotation operation that is carried out.

    When I subsequently rotate about the x or y axis after some rotation about the z axis, the rotation occurs does not behave as I require. Many thanks for your forthcoming help.

  2. #2
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: Rotation in 3D

    u have gimbal lock
    see here for advice http://www.sjbaker.org/steve/omniv/index.html

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2005
    Posts
    4

    Re: Rotation in 3D

    OK I have read the article on rotation but I am still no clearer as how to solve this problem. Thanks

  4. #4
    Junior Member Newbie
    Join Date
    Apr 2002
    Posts
    1

    Re: Rotation in 3D

    make them one function like this

    glRotatef(allangles,1.0f,1.0f,1.0f);

    works for me in DreamCast Programming which is what i am workin on now.

  5. #5
    Intern Contributor
    Join Date
    Nov 2001
    Location
    Ireland
    Posts
    92

    Re: Rotation in 3D

    zed, that link is dead for me.
    Any others?

  6. #6
    Junior Member Newbie
    Join Date
    Apr 2002
    Location
    Port Orchard, WA 98366
    Posts
    5

    Re: Rotation in 3D

    Originally posted by blood.angel:
    zed, that link is dead for me.
    Any others?
    http://www.sjbaker.org/steve/omniv/eulers_are_evil.html
    Those who would trade freedom for security deserve neither." -Benjamin Franklin

  7. #7
    Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    377

    Re: Rotation in 3D

    Originally posted by zeppelin:
    http://www.sjbaker.org/steve/omniv/eulers_are_evil.html [/B]
    internic say there is no www.sjbaker.org

    to the rotation problem:
    http://www.makegames.com/3drotation/

    that's the basic of the rotations i use

    hope it helps

  8. #8
    Junior Member Newbie
    Join Date
    Apr 2005
    Posts
    4

    Re: Rotation in 3D

    Many thanks guys


    Originally posted by satan:
    internic say there is no www.sjbaker.org

    to the rotation problem:
    http://www.makegames.com/3drotation/

    that's the basic of the rotations i use

    hope it helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •