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 4 of 4

Thread: Rotation

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2000
    Posts
    6

    Rotation

    HI

    As good as I know glRotate rotates an object about the origin, so do somebody know how to rotate an object about one of its point(not the origin).

    I know one solution:
    I move the object so that this point gets to the origin. Then I rotate the object then put it back to its real place.

    I don't want to write my own rotate function, so is there a way to do this with OpenGl functions?

    Thanks in advance

    NeckCracker

  2. #2
    Junior Member Newbie
    Join Date
    Mar 2000
    Location
    ...
    Posts
    28

    Re: Rotation

    hi there,
    imagine a cube..
    the very middle point of the cube is 0,0,0.
    (so the vertices could be from -0.5 to 0.5 for example)

    -0.5y ------------ 0.5y
    | |
    | 0.0 |
    | |
    | |
    ------------
    -0.5x 0.0x 0.5x

    So if you rotate now,the cube will rotate around its own axis..

    Now,if you dont want to rotate this way,
    just build the cube starting at -0.5 for exampleas the middle point (or take 0,0,0 as any edge point) and it will rotate around this point....
    sorry for the bad drawing,i hope i said everything right...

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2000
    Location
    ...
    Posts
    28

    Re: Rotation

    OOPS,looks like my picture has crashed...

  4. #4

    Re: Rotation

    Originally posted by holy_moly:
    OOPS,looks like my picture has crashed...
    Use UBB code... CODE tag will do fine...

Posting Permissions

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