Results 1 to 2 of 2

Thread: Rotating a third person camera

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2006
    Posts
    7

    Rotating a third person camera

    I am making a third-person shooting game, and basically i want the camera to rotate around an object (sorta like they way a planet revolves around the sun). How would i be able to accomplish this?

    AUGH why cant opengl make it as easy as drawing a sphere rotating around another sphere.

    Thanks alot guys,
    Psiborg

  2. #2
    Senior Member OpenGL Pro k_szczech's Avatar
    Join Date
    Feb 2006
    Location
    Poland
    Posts
    1,107

    Re: Rotating a third person camera

    It's not up to OpenGL to provide such functionality. OpenGL's main purpose is to let you use your GPU.

    Basically you need to compute camera position, and then look at player from that position (gluLookAt does the second part).
    Or you could just do something like this:
    Code :
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glFrustum(....);
    glTranslatef(0.0f, 0.0f, -distance);
    glRotatef(cameraAngleX, 1, 0, 0);
    glRotatef(cameraAngleY, 0, 1, 0);

Similar Threads

  1. Third Person Camera
    By ScorpZ in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-29-2012, 07:35 AM
  2. First Person Camera problem
    By humanitarian in forum OpenGL ES
    Replies: 1
    Last Post: 05-05-2011, 04:00 PM
  3. Third Person Camera Demo
    By dpoon in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 09-30-2006, 08:39 AM
  4. 3rd Person Camera
    By Binqay in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-06-2001, 11:40 PM
  5. How to make a 3rd person camera
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-18-2000, 03:26 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