Results 1 to 3 of 3

Thread: combining gluLookAt and object transformations

  1. #1
    Guest

    combining gluLookAt and object transformations

    Hi...
    I'm trying to write a simple application that allows one to place an object in the 3D space (by specifying translation/rotation coordinates), and to view the scene from any point in the space (by specifying eye coordinates and sight direction). I'm using gluLookAt(), as I have seen in many guides and tutorials.
    But something doesn't work well. If I call

    glLookAt(1.0, 0.0, -5.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0);

    and then

    glTranslatef(1.0, 0.0, 0.0);

    I think I should see the object in the center of my viewpoint (because it is in 1,0,0; my eye is in 1,0,-5, and looks at 1,0,0). But this doesn't happen: I see my object slightly shifted on the right.
    Could anyone help me?

    Thanks!!!

  2. #2
    Senior Member Regular Contributor
    Join Date
    Dec 2001
    Location
    London, England
    Posts
    160

    Re: combining gluLookAt and object transformations

    It should work.
    Is your object modelled around the origin (of object space)?

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2002
    Location
    Starkville,Mississippi,USA
    Posts
    20

    Re: combining gluLookAt and object transformations

    See if you using glOrtho or glPerspective they both work differently, first try with ortho then negate the Z and use it for glPerspective that should work

    ae97004
    Dont argue with fools, they bring you down to their level and beat you with experience.

Similar Threads

  1. Transformations: scene/object independent rotation
    By OglNewb in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-18-2010, 04:07 AM
  2. camera as object and gluLookAt
    By akashiraffee in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 02-28-2009, 03:25 PM
  3. Object-to-pixel coordinate transformations
    By lucafr in forum OpenGL: Advanced Coding
    Replies: 8
    Last Post: 09-12-2008, 07:27 AM
  4. glulookat vs. explicit transformations
    By lavalamp in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-09-2003, 06:22 PM
  5. Get the geometric transformations of an object
    By sergi in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 06-05-2002, 06:57 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