PDA

View Full Version : gluPerspective



vivek vyas
06-15-2009, 11:33 AM
i have created diagram of gluPerspective
in which i have question (if figure is wrong the excuse and give right figure as i want to understand it)


http://img1.orkut.com/images/milieu/1245065152/1245090384682/271392774/ln/Z1b6188j.jpg?sig=1i6zudh

i have question on basis of this figure(which i create to understand perspective)

Q1.as gluPerspective(fovy,As,znear,zfar). is angle is made on y axis(a point joining of 2 lines passes through a curve's terminal) called fovy

Q2. is zNear is always <=0.0f;

Q3.why we need aspect ratio in it


<<if image not visible then please try link: ]http://img1.orkut.com/images/milieu/1245065152/1245090384682/271392774/ln/Z1b6188j.jpg?sig=1i6zudh>>
thanks in advance

Rosario Leonardi
06-15-2009, 12:49 PM
q1: Yes, the fovY is the field of view in the Y (vertical) axis

q2: No, 0 < zNear < than zFar, zNear == 0 is illegal, if zNear is negative you image will be upside down.

q3: The aspect ratio is used to compute the field of view on the other axis. It's not computed automatically to leave more freedom to the programmer.

vivek vyas
06-15-2009, 07:59 PM
thanks i think these basic i need to know now i have question

Q1 if camera is used then will this(gluPerspective) updated.if yes how

Q2 the code fraction
glMatrixMode(GL_PROJECTION);<- i know projetion(farther smaller nearer bigger(perspective,frustum))
glLoadIdentity();
gluPerspective(let it filled);
glMatrixMode(GL_MODELVIEW);<- how it fnctioning
glLoadIdentity();
and
these glMatrixMode()glLoadIdentity() used two times in codes
at DisplayFunc and ReshapeFunc why? Without them theres only screen of glClearColor() or black?

Q3. if object either side of zNear,zFar,two lines make angle at y then is object invisible(i think must be)?

(Please Help me cause i programmed many code with them but don't know how that work like know how to drive but don't know how to repair(I am only 16.9 year old and know vector,Matrix(all of summ..,Multi..),Little bit plane)
so please help me regard these which is not out of that maths
)
thanks in advance