Jump to content
  • Advertisement
Sign in to follow this  
Ravana

Linear geometric objects inside sphere test

This topic is 1886 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 All,

 

Say I want to check if some linear geom object (segment, tetrahedron,.. ) is fully inscribed by the sphere. 

 

I am thinking of testing if all the vertices of the linear object lies inside sphere and if so the object itself 

is inside the sphere. 

 

Is there a possibility that this test fails for linear objects?

 

Also, is there a fast algorithm to do this. 

 

Thank you.

 

Ravana

Share this post


Link to post
Share on other sites
Advertisement

All vertices inside will work for containment within any convex shape, which a sphere is so you are good to go.

 

The fastest method would be to test only vertices on the convex hull of the shape you are testing.

Share this post


Link to post
Share on other sites

even for concave objects this works, isnt it? basically if all the vertices are inside, you can not have a segment which goes from one vertice to the other making the object concave be outside sphere as the segments are linear.

Share this post


Link to post
Share on other sites

Yes, it works for objects which are concave being contained in a convex shape. (EDIT: just test the convex hull of the concave shape)

 

It DOESN'T work if you are testing a shape inside a concave shape though (e.g. a box in an L-shaped room, can cut the corner although all vertices are inside the L). It is the containing primitive which needs to be convex for the test to work, the contained shape can be anything.

Edited by Paradigm Shifter

Share this post


Link to post
Share on other sites

Yes. If the containing primitive is concave, the things are not the same. Thanks for the reply.

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!