## Re: [Mesa3d-users] Newbie - problem with clip planes

 Re: [Mesa3d-users] Newbie - problem with clip planes From: Marcelo E. Magallon - 2001-08-26 22:35:22 ```>> Adam Majer writes: > This might be a stupid question, but I cannot see anything if I > translate beyond the -1 4) but it doesn't help... I'm only drawing a simple triangle What kind of projection are you using and where are the near and far clipping planes? For example, you can use the gluPerspective function to set up a perspective projection matrix. You can also use glFrustum to set up a perspective projection matrix, too. Other possibility is to use glOrtho to set up an orthographic projection. In any case, two of the parameters for those functions are the near and far clipping planes. You can find a good explanation regarding this in an OpenGL tutorial (NeHe's for example), an OpenGL book (e.g., the Programming Guide) and a large number of computer graphics books (http://www.opengl.org/ has a list of resources). -- Marcelo ```

 [Mesa3d-users] Newbie - problem with clip planes From: Adam Majer - 2001-08-26 20:58:10 ```Hi all, This might be a stupid question, but I cannot see anything if I translate beyond the -1
 Re: [Mesa3d-users] Newbie - problem with clip planes From: Marcelo E. Magallon - 2001-08-26 22:35:22 ```>> Adam Majer writes: > This might be a stupid question, but I cannot see anything if I > translate beyond the -1 4) but it doesn't help... I'm only drawing a simple triangle What kind of projection are you using and where are the near and far clipping planes? For example, you can use the gluPerspective function to set up a perspective projection matrix. You can also use glFrustum to set up a perspective projection matrix, too. Other possibility is to use glOrtho to set up an orthographic projection. In any case, two of the parameters for those functions are the near and far clipping planes. You can find a good explanation regarding this in an OpenGL tutorial (NeHe's for example), an OpenGL book (e.g., the Programming Guide) and a large number of computer graphics books (http://www.opengl.org/ has a list of resources). -- Marcelo ```
 Re: [Mesa3d-users] Newbie - problem with clip planes From: Damien Touraine - 2001-08-27 08:41:14 ```Marcelo E. Magallon wrote: >>>Adam Majer writes: >>> > > > This might be a stupid question, but I cannot see anything if I > > translate beyond the -1 > 4) but it doesn't help... I'm only drawing a simple triangle > > What kind of projection are you using and where are the near and far > clipping planes? For example, you can use the gluPerspective function > to set up a perspective projection matrix. You can also use glFrustum > to set up a perspective projection matrix, too. Other possibility is > to use glOrtho to set up an orthographic projection. In any case, two > of the parameters for those functions are the near and far clipping > planes. > > You can find a good explanation regarding this in an OpenGL tutorial > (NeHe's for example), an OpenGL book (e.g., the Programming Guide) and > a large number of computer graphics books (http://www.opengl.org/ has a > list of resources). > In fact, there is 8 or more clipping planes (depending on the OpenGL implementation). By default, they are all disable. Thus, you don't have to explicitly disable them. Your problem come from another part! As pointed by Marcelo your problem surely come from the projection matric. The projection matrix (glMatrixMode(GL_PROJECTION)) introduce six other clipping planes (fully dissociated from the upper ones) that define the volume you see through your window. If you define a glOrtho, the center of your viewable volume is the point 0, 0, 0 ... However, with perspective matrix, the 0, 0, 0 point is the position of your eye. The near clipping plane, that is away from your eye, exclude the point 0, 0, 0. Then, you must use a translation to put the 0, 0, 0 point into your viewable volume (something like glTranslation(0, 0, -Far + Near)) Friendly Damien TOURAINE -- -------------------------------------------------------------------- Damien TOURAINE - +33 1 69 85 81 68 Doctorant au LIMSI - CNRS (http://www.limsi.fr) Bat. 508, Universite Paris-Sud 91403 Orsay cedex -------------------------------------------------------------------- ```