Jump to content
  • Advertisement
Sign in to follow this  
Funkymunky

Dividing a Mesh in Two

This topic is 4138 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 basically want to split a mesh with a plane. So I make two new meshes, then I loop through all the original mesh's triangles determining which side they're on. What about triangles that the plane cuts directly through? I need it to line up precisely, such that for a mesh which has been split into two and has each piece remain in its original location, no seam is visible.

Share this post


Link to post
Share on other sites
Advertisement
Clearly the triangles that the plane cuts directly will have to be split into 2 triangles/quads.

This shouldn't be to hard. just find the 2 points from the triangle that intersects with the plane and use them to make 2 more triangles. Put in mind that you may not end up with 2 triangles but maybe a triangle and a quad. You may need to split the quad into 2 more triagles if you're class/structs only take triangler faces.

This is only works with the 3D object it self and not it's texture coordinates. The only thing I can think up is to intepolate the new coords from the cut faces.

May I ask why would you need such an operation?? seems fun :P

Hope this helps.

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!