Jump to content
  • Advertisement
Sign in to follow this  
Betalord

Clipping triangle against AABB

This topic is 2987 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

Hi,
I want to build an octree by clipping triangles against ocnodes (which are AABBs of course). Can anyone explain and/or provide some source code on how to do it?
My general idea is to split triangle against a plane (alix-aligned plane, or how is it called) and then repeat it for all 3 planes of an ocnode, but I am having problems. I am not sure how to reassign new texture coordinates (which are 2D/UV coordinates), also I'm not sure how to create 2 triangles out of a quad properly (triangle orientation must probably be preserved?) etc. Any help would be appreciated!

Share this post


Link to post
Share on other sites
Advertisement
Correct me if I'm wrong, but would it not be simpler to clip whole batches of geometry (ie. meshes), by calculating a bounding volume for the batch and then clipping that against the AABBs of the octree?

Share this post


Link to post
Share on other sites
Speed is not an issue here. Also I don't have batches of geometry available. But yes, if I were doing this in realtime, I would devise some more clever strategy.

But still, my problem remains - I need triangle versus AABB clipping algorithm in any case.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!