Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am currently trying to look into techniques that allow the calculation of arbitrary cross-sections of a 3D object or rendered volume. However, I have been unable to find much on the topic. I know of some software packages, such as the SolidWorks CAD package, that employ such techniques; as seen here:

Cross Section of a Locomotive in SolidWorks

Does anyone know of any available methods, techniques, algorithms, or tutorials that aim to achieve this result? Also, in terms of the theory of this technique and the concept of calculating it on the fly; how performant is such a technique likely to be?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

If you just need to render the cross-section, you can specify a clipping plane. For example in OpenGL you can call glClipPlane and OpenGL will take care of everything else. Alternatively you can probably do the same thing in a shader.

If you need the actual geometry of the cross section, you can clip every polygon against the clipping plane. When a polygon is clipped partially, the vertex count is often increased, but the math behind it isn't anything tricky. You should be able to find tutorials for that with Googling using the keywords frustum, culling and clipping, such as this site.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.