PDA

View Full Version : detecting if within a 3D model



neilw
11-08-2002, 05:49 AM
Hi

I have an object, a complex object at that, (this has nothing to do with display etc so no probs with effiecency), basically i need to produce a 3D binary matrix, where a 1 indicates the object (ie on surface or inside the object) and a 0 indicates not on/inside.
Question is how can i go about producing this matrix from an opengl model? Which method can i use to enable me to do this?

I think i have an idea on how to do this to form a matrix of the skin(so to speak) of the model, but then how can i do it for the body of the model?

Gavin
11-08-2002, 06:47 AM
Maybe a combination of gluproject/unproject and the depth buffer. Find the near and far planes of polys at that scren x,y to determine if you are within your model.