View Full Version : Clipping contour?
01-29-2004, 07:20 AM
Is there any way to get the clipping contour of the object being clipped when using glClipPlane?
01-29-2004, 11:16 AM
What do you want, exactly? Do you want the gometry of the intersection in some form, or do you just want a graphical projection of it? Correct me if I'm wrong, but I don't think the first can be done automatically. There are hackish ways you could get an image of that projection, though.
Why do you want to do this? There may be a better way to solve the problem.
01-30-2004, 12:38 AM
What I was thinking was getting the intersection between the clipping plane and the object being clipped. The intersection between the plane and the object (a set of polygons) would be a contour of lines. This way I would have a clear visualisation of the section. Although, I think there is no opengl function for that. I probably need to calculate this intersection and then render these contours.
01-30-2004, 04:18 AM
There is a textbook technique, capping found in the red book. Will it serve your need?
01-30-2004, 06:06 AM
Create a 3D texture with one black layer and the remaining white. Set TexGen to Object Linear and use the texture matrix to transform the plane (== the black layer in the 3D texture) up and down.
Otherwise you can do the coloring using vertex / fragment program and change the fragment color depending on the object positions z coordinate
01-30-2004, 08:00 AM
You don't need a 3D texture. A 1D texture with a single black pixel and the rest white will suffice; just map it along the plane of clipping using linear texgen.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.