# Thread: gluLookAt an' the Up vector

1. ## 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. ## 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. ## 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. ## 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. ## 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).]

6. ## 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.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•