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

Thread: rotation question

  1. #1
    Junior Member Newbie
    Join Date
    May 2004
    Posts
    1

    rotation question

    How do I rotate about an object while keeping it in view? That is, rotating around an object while still keeping the object in sight and still having the same distance.

  2. #2
    Junior Member Newbie
    Join Date
    May 2004
    Location
    NY
    Posts
    18

    Re: rotation question

    A "look-at" function is what you're looking for. gluLookAt() is a start. However there are more robust functions that'll let you actually orbit object A around object B while keeping object A facing object B. Check Google for this.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Hannover, Germany
    Posts
    1,258

    Re: rotation question

    Rotate the object in object space, ie. first do the rotation around it's center (usually that's the origin of objects, if not you need to move it there, rotate and move it back) and only after that move it to it's world position.
    - Michael Steinberg

Posting Permissions

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