Ray Trace

Blitz3D Forums/Blitz3D Programming/Ray Trace

Almo(Posted 2003) [#1]
I've looked through the code archive, and there's almost what I need, but not exactly...

I want to do a raytrace, and find out the entity hit, and the world-space coordinates where it's hit.


Rob(Posted 2003) [#2]
LinePick command is your man.
;picked will be 0 or the entity the ray hits
picked = LinePick(x,y,z,dx,dy,dz)

Lets find out where? PickedX(),PickedY() and PickedZ() tells us! How about the normals of the surface we picked? (bullet richochets, angles and more) PickedNX(), Y and Z!


Almo(Posted 2003) [#3]
Right! Didn't know about the Picked functions. I feel silly again. Thanks dude!


poopla(Posted 2003) [#4]
Then you can get your PickedX#(), PickedY#() PickedZ#(), PickedNX#(), PickedNY#() PickedNZ#(), etc etc. :)


Rob(Posted 2003) [#5]
Didn't I say that?


Almo(Posted 2003) [#6]
He's talking about the hashes maybe?