Hi
I've written some game animation that uses very simple 3D transformations. Nothing too complex...
position.X =((x*perspective)/z)+screencentreX
position.Y =((y*perspective)/z)+screencentreY
(where x,y,z, etc are object instance variables)
Now, I would like to loop through the objects (I'm using a family called 3DSprite) and using math, see if any of the 3D objects are overalapping each other in 3D space (everything is a sphere, so the math is a simple distance to center of both 3D objects being less than sum of object radius). Note all 3D vector, radius and calculated 2D screen position values are held in family in instance variables for reference.
I'm getting my self tied in knots. I can't seem to see to find an easy way to "nested loop" through all the 3DSprite family objects. To my mind it's a loop (A) through the object family followed (sub event?) loop (B) through the objects again. Then, comparing (A) instances variables with (B) variables if (A) object != (B) objects.
Any help greatly appreciated. Once I crack this, then 3D collision math is easy and I can blend 2D with a nice 3D animation :)