Results 1 to 6 of 6

Thread: gluLookAt an' the Up vector

  1. #1
    Guest

    gluLookAt an' the Up vector

    Anybody knows how to set the Up vector, to look up. I mean something like this:
    gluLookAt(0,0,0, 0,1,0, upx, upy, upz);
    The Up vector can't be (0,1,0), because the results are very uncool, so what shuold I put as this vector???

  2. #2
    Senior Member Regular Contributor
    Join Date
    Sep 2011
    Posts
    150

    Re: gluLookAt an' the Up vector

    Originally posted by Nut Cr4ck3r:
    The Up vector can't be (0,1,0)
    The up vector makes since if you think of the following example coordinate system ... looking at an OpenGL window with lower-left being the origin: x increases to the right, y increases up, z increases towards you.

    [This message has been edited by brcain (edited 02-18-2004).]

    [This message has been edited by brcain (edited 02-18-2004).]

  3. #3
    Guest

    Re: gluLookAt an' the Up vector

    So if I want to look up (and see some geometry), then I should set up vector to let's say (0,0,-1)? And nothing else?

  4. #4
    Senior Member Regular Contributor
    Join Date
    Sep 2011
    Posts
    150

    Re: gluLookAt an' the Up vector

    It actually depends upon your geometry. I suggest reading Chapter 3 - Viewing of the OpenGL Programming Guide. There are several examples that utilize gluLookAt().

  5. #5
    Senior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    156

    Re: gluLookAt an' the Up vector

    so if i walk on a sphere, my position has to be the up vector if i want the sphere to at the bottom ?

    [This message has been edited by HamsterofDeath (edited 02-19-2004).]
    go vegan

  6. #6
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    Philippines
    Posts
    11

    Re: gluLookAt an' the Up vector

    This doesn't really answer the original, but I messed with the last three params of gluLookAt() before, thus the Up vector, and it eventually lead me to the gimbal lock. just a note. Correct me if i'm wrong, this gimal lock will attack once you try to do something like this:

    [QUOTE]Originally posted by HamsterofDeath:
    [B]so if i walk on a sphere, my position has to be the up vector if i want the sphere to at the bottom ?

    But if you got this fixed then there's no problem.

Similar Threads

  1. gluLookAt up Vector cross product
    By macsam in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-10-2017, 09:27 AM
  2. Replies: 1
    Last Post: 10-01-2009, 06:04 PM
  3. Up-Vector of gluLookAt( ... );
    By OGL_PGR in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-29-2005, 08:40 PM
  4. Up-Vector of gluLookAt( ... );
    By OGL_PGR in forum OpenGL: General
    Replies: 0
    Last Post: 08-29-2005, 03:03 AM
  5. Replies: 2
    Last Post: 01-07-2004, 11:48 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