View Full Version : How to identify the conjoint edge of two faces?

01-07-2003, 04:48 PM
I want to identify the conjoint edge of two faces or polygons by pixel information, ie, given a pixel, I want to know if it is a pixel on an conjoint edge of two faces or polygons. Anyone can help me?

01-07-2003, 05:28 PM
Treat the edge as a line segment and consider the ray from the camera through the pixel, both in 3D space. See if the closest point of the line segment to the ray is within some small epsilon, where the epsilon is a linear function of distance to compensate for perspective (ie, epsilon * distance). www.magic-software.com (http://www.magic-software.com) has a lot of testing algorithms if you don't know how to do ray to line segment distance checks.

01-07-2003, 07:36 PM
Render each polygon in a unique color, use glReadPixels to get the "local region of the pixel of interest, then check neighbor pixels for color difference.

Badda bing, badda boum

01-07-2003, 09:19 PM
My way is faster http://www.opengl.org/discussion_boards/ubb/biggrin.gif

01-12-2003, 05:12 PM
Thanks you all. Let me have a try.