PDA

View Full Version : Collision detect



NeckCracker
06-13-2000, 11:36 AM
Hi!
I have some question about collision detect.
I was thinking how to make one, and come to the selection render mode. I was thinking if I could draw only one point then I could check if both object are drawn at this point.
My problem is that I don't know how to do it.
I can check which object is at a final screen coordinate, but I want to check it in real world coordinates (x,y,z).
I have another question. How can I get the final vertex coordinates?
I mean I define a few vertices and then I move and rotate and scale them. How can I get the transformed vertex coordinates.

Thanks in advance
NeckCracker

DFrey
06-13-2000, 01:42 PM
I'm assuming you mean you use glRotate, glScale, and glTranslate. Well, you can continue to use those, in which case you'll need to copy the modelview matrix after all transforms have been concatenated and then multiply the object's vector(s) by the modelview matrix. The better way I believe is to use your own matrix routines for translating, rotating and scaling. Then when you transform the vector by your view matrix, you automatically have the coordinate(s) to use for both drawing and collision detection. BTW you want to set GL's modelview matrix as an identity matrix when you do it this way.