how would I mathematically check for a 3D point inside a volume?

In 2D I checked to see if a point was inside a shape by creating triangles between 2 neighbouring points and the centre of the object, then checking the angle to the 3 points from the test point and if the sum = 360... If not then it isn't inside the triangle.
But how would I check if a point is inside a volume rather than an area? I know the same method would work but I don't think very well as it'll be testing with the thickness of the shell of the 3D object, which may be quite easily jumped in a single frame of movement...

How else could I do it?
You can compute the full solid angle: http://en.wikipedia.org/wiki/Solid_angle. If the point is inside it should be 4pi.
Well I cant understand that wiki post at all so I'll ask my maths tutor on Monday, anything else while that's on the back burners?
Bump
How is your volume defined ?
Is it a specific shape, a polyhedra, a parameterized surface ?
Honestly I haven't got a clue without googling all of those.

But the volume is defined by a known value and quantity of points in 3D space, the points are linked together using groups of 3 integers (representing the index value of each point) to form triangles... A list of triangles make up the shapr
Last edited on
You should have a look at 3D graphics literature, I'm sure you would find ideas.

If your shape is convex, you could do something like the Sutherland-Hodgman algorithm. Basically, using cross products you determine which side of each triangle lies the point. If the point is located towards the inside for every triangle, then the point is inside the shape, otherwise it's outside.

The determination of the side of the point depends heavily on the order in which the triangles and their edges are provided.
*Bump*

My maths tutor says that its very difficult to explain solid angles until about degree level because of the concepts which go into it.
Any other ideas? Or @toum could you post a link please to an article or such about this algorithm?
Topic archived. No new replies allowed.