Results 1 to 5 of 5

Thread: Rotating viewpoint around a 3d object

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2001
    Posts
    17

    Rotating viewpoint around a 3d object

    Hey everyone. I have a question about rotating my viewpoint around an object. I know how to rotate the actual object (ex. glRotatef(angle, 0,1,0) ), but i want to know how to rotate my VIEWPOINT around. Hope that makes sense. Thanks

  2. #2
    Member Contributor
    Join Date
    Apr 2002
    Posts
    94

    Re: Rotating viewpoint around a 3d object

    Rotating or moving your viewpoint and moving the models are essentially the same thing. For instance, you can either move the model away from the camera 10 meters or move the camera away from the model by 10 meters. Both are the same code, it's just a matter of how you think about it. You still use the MODELVIEW matrix for both.
    P4 2Ghz, GEFORCE4, 512 Meg RAM, WIN2000, VStudio 6.0

  3. #3
    Member Contributor
    Join Date
    Jul 2001
    Location
    Sherbrooke
    Posts
    95

    Re: Rotating viewpoint around a 3d object

    I suggest you use gluLookAt for your camera system and you can turn around a point with cos and sin and an angle around the y axis by setting your AT coords to the position of the object you want to turn around
    and set your camera's EYE coords to this :
    X : distance*cos(angleY)
    Z : distance*sin(angleY)
    and increment your angleY at each loop
    Hope it helps !

    -------------------------------------------
    Evil-Dog
    *Sleep is a waste of time*
    Let's have a funny day

  4. #4
    Junior Member Newbie
    Join Date
    Oct 2001
    Posts
    2

    Re: Rotating viewpoint around a 3d object

    there is some good camera movement
    code in this project:
    [<http://astronomy.swin.edu.au/pbourke/opengl/stereogl/>]

  5. #5
    Member Newbie
    Join Date
    Oct 2001
    Location
    Beijing, China
    Posts
    37

    Re: Rotating viewpoint around a 3d object

    To avoid confusing, you'd better consider the whole 3D sence standstill with absolute coordinates but the camera moves.
    All that you need to do is to handle the movement of the eye coordinates and the target coordinates and then call gluLookAt(). You may check my Pool3D page on http://zone999.top263.net
    Hope you know what.


    [This message has been edited by Dong Ke (edited 10-25-2001).]

Similar Threads

  1. Replies: 0
    Last Post: 10-28-2014, 08:51 PM
  2. Changing a viewpoint of an object without cam move
    By heavenssake007 in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 01-21-2009, 01:21 AM
  3. Replies: 4
    Last Post: 08-30-2006, 09:30 PM
  4. rotating and object without rotating its axis
    By scam in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 12-17-2003, 08:30 AM
  5. Replies: 1
    Last Post: 03-11-2001, 01:55 AM

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