   Does a point belong to a pyramid/cuboid?
  Hi everyone,I am looking for algorithm which decide whether a point belongs to a pyramid/cuboid.However, I haven't found anything.Can you help me?Thanks a lot![Edited by - Mihulik on May 6, 2009 12:30:08 AM]
  I may be about to embarrass myself here, but I must admit I'm not familiar with the usage of the term 'ashlar' in this context. The first few pages of a Google search return references to masonry, for the most part. For the uninitiated, could you perhaps clarify what you mean here?Meanwhile, a straightforward way to test if a point is contained within a convex shape is to perform a half-space test between the point and each of the hyperplanes that bound the shape; if the point lies in the same half-space (positive or negative) with respect to each hyperplane, then it is contained.   ;Quote:Original post by jykI may be about to embarrass myself here, but I must admit I'm not familiar with the usage of the term 'ashlar' in this context. The first few pages of a Google search return references to masonry, for the most part. For the uninitiated, could you perhaps clarify what you mean here?I'm sorry. I'm not English native speaker and I don't know which vocable is correct.I mean cuboid ( http://en.wikipedia.org/wiki/Cuboid ).I was making decision whether use ashlar or cuboid. My decision was wrong:-)Quote:Meanwhile, a straightforward way to test if a point is contained within a convex shape is to perform a half-space test between the point and each of the hyperplanes that bound the shape; if the point lies in the same half-space (positive or negative) with respect to each hyperplane, then it is contained.It seems well:-)   ;  alternatively for a cuboid the test can be made a bit simpler if you can easily transform a point to the cuboids coordinate system, as you can then simply perform the following test with the transformed point.bool inside = (x>=-w&&x<=w && y>=-h&&y<=h && z>=-d&&z<=d);with w,h,d being the respective half-width, half-height, half-depth given that the cuboid's origin is at it's centre.   