Skip to main content
gamedev.net
🔒 Locked

Point inside...

Started by Arch 1 reply 400+ views
Original Post
Arch
Arch
And the fastest metod to determine if a point is inside a hexagon ?? (I''m speaking in 3D) Thanks !
yellowjon
yellowjon
But the hexagon is still 2d right? First you can see if the point is coplanar to the hexagon. If so, then you''ve reduced it to a 2 dimensional case (Simply take 2 vectors that span that plane and use those as your new coordinate system). Then - use some point in polygon test. For example, The jordan something theorem (I''ve forgotten the name) says that you can draw a ray starting from that point outwards in any direction. If it intersects an odd number of lines of the polygon, then it is inside. Otherwise, it is outside. There are many other ways to do this too.
grhodes_at_work
grhodes_at_work
Check the forum FAQ for a link to a web page describing point-in-polygon test techniques.

Forum FAQ

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.