# The Industry's Foundation for High Performance Graphics

#### from games to virtual reality, mobile phones to supercomputers

Hello,

I am trying to use gluLookAt with perspective projection to "view" a 2d array of square polygons of different colors that I have drawn. The problem is I can only see a few of these. I believe that I need to adjust the first 3 args to gluLookAt but am not sure if I need to adjust the others as well. I currently have:

gluLookAt(0, 0, 350, 0, 0, 0, 0, 1, 0);

in my display function.

http://www.opengl.org/developers/gaq...al/viewing.htm

Any suggestions are appreciated.

Thanks.

2. ## Re: confused about gluLookAt

Increasing viewangle will help,
heres some more complete camera code
that may help

float eyex, eyey, eyez; // eye
float near, far; // near and far clipping distance
float viewangle; // vertical view angle in degrees
float twist; // rotation angle about the view axis

int width, height; // input canvas width and height

// temp variables
float upx, upy, upz;
float aspect;
float rx, ry, rz;

glMatrixMode(GL_PROJECTION);
aspect = (float)width/(float)height;
gluPerspective(viewangle, aspect, near, far);
rx = coix - eyex;
ry = coiy - eyey;
rz = coiz - eyez;
if (rx != 0.0 &#0124; &#0124; rz != 0.0) {
upx = 0.0; upy = 1.0; upz = 0.0;
}
else {
upx = 0.0; upy = 0.0; upz = -1.0;
}
gluLookAt(eyex, eyey, eyez, coix, coiy, coiz, upx, upy, upz);
glRotatef(twist, rx, ry, rz);

#### Posting Permissions

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