🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Set faces to face outside of 3d convex shape

Started by
4 comments, last by _WeirdCat_ 6 years, 1 month ago

How to do this? For some weird shapes calculating center point as a reference doesn't seem to work. Ideally I could find some other point that lies inside polyhedra...

Advertisement

I use the center point. For which weird shapes it is not working for you. Do you have an example?

Well to be honest during coding i just imagined a 2d triangle that height of it is 0.1 and the width is like 100000.0

Inagine

vec3( -100000.0, 0.0, 0.0 );

vec3( 0.0, 0.0, 0.0 );

vec3( 0.0, 0.1, 0.0 );

I asked cause i imagined that the center point will lie outside, however I didn't check it i just thought there must be a case where center point lies outside, and i found that i have no idea how to compute a point that lies within convex hull ?

How can a center point be outside a convex shape? There are many ways to compute an interior point. You build the AABB and use its center. This has edge cases where the interior point can lie on the surface. You can build the average of all vertices. You can use the center of mass.

So maybe i was wrong,

How can a center point be outside a convex shape well I don't know...

Thanks for help

This topic is closed to new replies.

Advertisement