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...

Similar Threads

  1. Rotation of an object by rotation matrix
    By MrFoil in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-02-2015, 04:41 PM
  2. Matrix Rotation loses 1 axes of rotation
    By Benzino in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-15-2011, 06:53 AM
  3. Replies: 1
    Last Post: 04-16-2010, 02:59 PM
  4. changing axis of rotation and center of rotation in openGL performer
    By ravishashi in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 07-08-2003, 04:42 AM
  5. world rotation v. body rotation
    By cosmicGirl in forum OpenGL: Basic Coding
    Replies: 31
    Last Post: 03-11-2003, 12:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean