View Full Version : lighting problem
hi!... I've got some problems in lighting... actually a lot of problems...
I've defined two cubes, one light source, and material stuff for the cubes. I can see them perfectly with the desired color until I change the first three values of gluLookAt(), its simply disappeared. Could someone tell me what is going on?
12-29-2001, 09:49 AM
I think that you don't understand the "gluLookAt" function.
Here's a description taken on the blue book :
gluLookAt - define a viewing transformation
void gluLookAt( GLdouble eyex,
GLdouble upz )
eyex, eyey, eyez
Specifies the position of the eye point.
centerx, centery, centerz
Specifies the position of the reference point.
upx, upy, upz Specifies the direction of the up vector.
gluLookAt creates a viewing matrix derived from an eye point, a reference
point indicating the center of the scene, and an up vector. The matrix
maps the reference point to the negative z axis and the eye point to the
origin, so that, when a typical projection matrix is used, the center of
the scene maps to the center of the viewport. Similarly, the direction
described by the up vector projected onto the viewing plane is mapped to
the positive y axis so that it points upward in the viewport. The up
vector must not be parallel to the line of sight from the eye to the
The matrix generated by gluLookAt postmultiplies the current matrix.
12-29-2001, 12:36 PM
Did you look under the desk? Whenever I move stuff around and lose something, it always ends up under the desk. http://www.opengl.org/discussion_boards/ubb/wink.gif
Seriously... since moving the camera is a trivial thing, you are going to need to go into more detail. Just saying "I moved the camera and now I can't see the cubes" isn't enough.
1. You are viewing the dark side of the cubes with no ambient light and a black background.
2. Your "up" vector is nearly parallel with the camera direction.
3. The eye position is the same as the center position.
4. The cubes are not in the view frustum.
5. The cubes are clipped by the far clip plane.
6. The cubes are clipped by the near clip plane.
7. The camera is inside one of the cubes and the other is outside the view frustum.
8. You are doing more than just changing the first 3 gluLookAt parameters.
[This message has been edited by Jambolo (edited 12-29-2001).]
thank you guys for the so extensive explanation!
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.