Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

gluLookAt

2»

Comments

  • chris666chris666 Member Posts: 71
    : : Nope, I have a glMatrixMode(GL_DEPTH_TEST) in the Init part and glMatrixMode(GL_PROJECTION) and glMatrixMode(GL_MODELVIEW) in the ResizePart and those are the only glMatrixMode calls in all my code
    : :
    : :
    : the Init and ResizePart of my Window I mean offcourse, not the Camera :-)
    :

    Ok, so gluLookAt doesn't need the Perspective matrix to be active. It would have been cool that experienced people post some explanations, I'm just a very beginner in GL

  • iDaZeiDaZe Member Posts: 464
    Posting a reply to this message is not allowed, the reply chain can only be up to 10 posts deep. Try to post a new message or reply to a earlier message.

    ...
    doh


    anyway, I'm still pretty new at this too (I quit Graphics coding a little while to concentrate on my study, but then I got this itch to start again ;-)), anyway, I don't think there really are any OpenGL guru's on this board ... to bad, guess we're all stuck with each other ;-)
  • DrGonzoDrGonzo Member Posts: 41
    I had that same problem when i first used LookAt. Just watch where you place the line. Place the camera(LookAt) THEN the draw draw scene/world.
  • KasukoKasuko Member Posts: 1
    I know this is a very old post, but I search gluLookAt in google and this was on the front page so I couldn't let it have it's poor information.

    gluLookAt is NOT supposed to be called on the projection matrix. It is supposed to be called on the modelview matrix, that is why it is called the modelVIEW matrix.

    See article here [link=http://www.opengl.org/resources/faq/technical/projection_abuse.php]Projection Abuse[/link]

    As for order its always best to put the gluLookAt function right after the initial glLoadIdentity call so that it is the last applied. (Because matrix operations are performed in reverse order of their calls in OpenGL due to matrix multiplication)

    so in short your code should look like
    [code]glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    gluLookAt(eye.x, eye.y, eye.z, focus.x, focus.y, focus.z, 0, 1, 0);
    //Model Transformations[/code]

    Sorry for bringing up such an old post.
    Kasuko
2»
Sign In or Register to comment.