PDA

View Full Version : clipping polygons



06-14-2003, 09:44 AM
hi there

just starting out with opengl ... i need to find the intersecting region b/w 2 polygons and to know the area/perimeter/vertex points of that region
is there an opengl function which can do this?if so, how?

thanks in advance

dorbie
06-14-2003, 08:46 PM
There is no OpenGL function to do this.

You need to code for this type of geometry problem yourself or use another library that offers this type of functionality.

06-15-2003, 02:37 AM
Hi

thanks for the reply
what about finding the intersection region between a polygon and a square/cube
i know that i can use glClipPlane to draw the intersecting region between a polygon and a square domain , but is it possible to retieve the coordinates of the drawn polygon also

thanks in advance
-mayank



Originally posted by dorbie:
There is no OpenGL function to do this.

You need to code for this type of geometry problem yourself or use another library that offers this type of functionality.

mdog1234
06-15-2003, 06:58 AM
there is no way to just recieve the coordinates from opengl but with a little math you can figure it out. Do something like this.

GLfloat mtx[4][4] = {0};
glGetFloatv(GL_MODELVIEW_MATRIX, mtx);

then you just need look at the matrix to see what your coordinates are