Results 1 to 3 of 3

Thread: Translate and Rotate the camera?

  1. #1
    Member Contributor
    Join Date
    Apr 2000
    Staten Island New York

    Translate and Rotate the camera?

    I'm following the procedures from the RedBook
    and the SuperBible for the order of transformations. I would like to know at what
    transformation can the camera be manipulated with the keyboard?
    I thought maybe the modelview transform,but
    the camera was set with gluLookAt and the viewport was defined with gluPerspective.
    What function is left to manipulate the camera?

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Feb 2000

    Re: Translate and Rotate the camera?

    Use the modelView matrix, it is more simple to know what will happen then. With the Projection Matrix, it's kind of messy.

    There is actually no camera. Objects are moved from a reference point(usually 0).

    The camera is just a way to simplify the concept.

    when you say glTranslate(-1.0,0.0,-2.0)

    you are moving the objects -1.0 on the x axis from the reference point or the camera and -2.0 on the z axis from the reference point.

    glulookat simply encapsulate gltranslate and glrotate function.

    There is one catch with the camera. If you say you want to move the camera two units up on the Y-axis, you must not use
    glTranslate(0.0,2.0,0.0), because like I told you glTranslate move the vertices from a reference point. You must use


    this exactly what glulookat do, when you specify a position of 0.0,2.0,0.0, it calls

    glTranslate(0.0,-2.0,0.0). It inverts the signs to simulate a "movement", but it is actually the objects that moved.

  3. #3

    Re: Translate and Rotate the camera?

    When U call glTranslatef, I think the models are moved with respect to the origin of the coordinate system. Gorg, could u please throw some more light on this topic?


    [This message has been edited by abhijeet_maharana (edited 07-13-2003).]

Similar Threads

  1. Translate after rotate
    By Darius in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 11-01-2012, 07:23 PM
  2. Translate + Rotate problem.
    By Tivin in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-21-2009, 01:34 PM
  3. problem with Rotate() and Translate()
    By openujs in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-26-2005, 09:38 AM
  4. rotate ..translate...what is?
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-15-2001, 05:51 PM
  5. Represent Rotate and Translate by one Translate
    By Luin in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 07-02-2000, 01:54 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