PDA

View Full Version : how to clip ??



hellrage
03-31-2002, 04:08 AM
Hi,
I realise that openGL do the clip automatically(chop all the points that off the screen view) But i would like to know whether anyone has the actual code on how to clip this points if it's off the screen? Thanx's....

V-man
03-31-2002, 10:35 AM
You will need to transform the point into clip coordinates, then see if it's inside your view.
gluProject() can do this or just multiply your vertex with the modelview, then the projection, Easy to do. Download the GLU source code (from SGI).

V-man

hellrage
03-31-2002, 04:29 PM
Hi,
you mentioned about downloading the GLU source code from SGI. Do you know where i can download this thingie? Thanx's.

chxfryer
03-31-2002, 09:57 PM
http://www.gametutorials.com has a frustum culling tutorial in the opengl sections. It tells you if a point/cube/sphere are in your view frustum.