Jump to content
  • Advertisement
Sign in to follow this  
Mastaba

2D silhouette cross-sections of arbitrary 3D models

This topic is 4400 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to google for some algorithms, preferably for the GPU, that can be used to draw 2D silhouette planar cross-sections of arbitrary 3D models. I'm not having any luck. I've also been trying to just create an algorithm on my own. I understand from the problem, that it is possible for the silhouette to be complex and disjointed, and that is throwing me for a loop.

Share this post


Link to post
Share on other sites
Advertisement
Do you need to fill the silhouette, or do you just want the outline? At any rate, you should be able to find the intersection of each individual polygon with the slicing plane pretty easily (just a plane-plane intersection, restricted to the area of your polygon). This will give you a big list of line segments in worldspace, which you can weld into polygons using the information you already have on which polygons are adjacent. You can then transform these polygons down to screen space and render.

In the case of filling them, I suppose you could keep track of which original polygons mapped to which line segments. When you transform the line segments into screen space, also transform the normals to the corresponding polygons into screen space. A simple dot product between the line segment (which, in this case, must be oriented correctly) and the transformed normal will tell you which side of that line segment is inside the silhouette and which is outside. This means you know the orientation of the polygon, which makes deconstructing it into triangles fairly simple.

Just off the top of my head. Did that make sense?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!