PDA

View Full Version : GLUT: confused about gluLookAt



cg-hci_novice
03-21-2003, 08:27 AM
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.

I read thru:
http://www.opengl.org/developers/gaqs/techinical/viewing.htm

but am still confused about this.

Any suggestions are appreciated.

Thanks.

nexusone
03-21-2003, 09:09 AM
The problem also could be in your perspective setup post it also.


Originally posted by cg-hci_novice:
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.

I read thru:
http://www.opengl.org/developers/gaqs/techinical/viewing.htm

but am still confused about this.

Any suggestions are appreciated.

Thanks.

cg-hci_novice
03-21-2003, 09:58 AM
Here it is:

gluPerspective(60, 1, 1, 10000);

nexusone
03-21-2003, 11:28 AM
Try making the 350(z) in the look at to a -350.
If that does not work, try increaseing the value.



Originally posted by cg-hci_novice:
Here it is:

gluPerspective(60, 1, 1, 10000);

cg-hci_novice
03-21-2003, 12:04 PM
I tried what was suggested (altering z value in both directions). However, it still doesnt't seem like the polygons are covering more than 30% of the screen. (I am expecting that they should cover the entire screen with many gaps). Maybe the problem is actually with how they have been drawn?

I would appreciate any other suggestions/references?

Thanks.

nexusone
03-21-2003, 05:33 PM
Have you also tried moveing your object out or scaling them down.


Originally posted by cg-hci_novice:
I tried what was suggested (altering z value in both directions). However, it still doesnt't seem like the polygons are covering more than 30% of the screen. (I am expecting that they should cover the entire screen with many gaps). Maybe the problem is actually with how they have been drawn?

I would appreciate any other suggestions/references?

Thanks.

cg-hci_novice
03-21-2003, 08:18 PM
Thanks for your help.

I understand the gluLookAt a little better now and it seems like the problems could be as related to my logical x and y coordinates as they are to the args passed to gluLookAt. So, I'm going to try to work on figuring out the logical x, y values I need to use for a while and then hopefully, it will be easier to set reasonable args for gluLookAt too.

Thanks again.

cg-hci_novice
03-24-2003, 05:58 PM
Hi,

I've resolved this problem so this topic maybe closed by the adminstrator.

Thank you.