Ray collision coordinates

Previous topic - Next topic

jestermon

I am looking at finding the actual world coordinates for a ray collision against an object in order to apply "bullet holes" to walls and other surfaces.
Since in low level OpenGL, one  uses Dot Product Between Plane Normal And Ray Direction to determine collisions - is it possible to do this type of low level of detection in GLBasic?

Edit: After some thought, I think I don't need to go to polygon level. I've not yet done a test program, but I think the following solution may be quick and easy and do just what I need.
1.. Get collision ray distance: If positive.
2.. Extend the direction vector to the length of the ray, and derive the collision coordinates.

Now with the coordinates available based on the vector length, the next question arises: How do I get the surface normal at point of collision? Is this possible at a high level?

kanonet

I think X_GETFACE should be a strong hind how to solve your problem. ;)
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

jestermon

Aha. Yes, I see it now. Thanks kanonet, X_GETFACE is just what I need.
Still being new to GLB, I have a lot of functions to go through, and the solutions are still not so obvious. But once one sees them, the light switches on.