Testing Angle of Surface When Collided

Blitz3D Forums/Blitz3D Programming/Testing Angle of Surface When Collided

Knight #51(Posted 2009) [#1]
Is there any way of getting the angle of the triangle/surface your object just collided on?


GIB3D(Posted 2009) [#2]
Yes, in the form of... PickedNX/Y/Z, VertexNX/Y/Z and maybe some others... I made this a few weeks ago...

http://blitzbasic.com/codearcs/codearcs.php?code=2449

This is just a guess, but I think you could just do the Normal*360 to see the real angle.


Ross C(Posted 2009) [#3]
I don't know if that would work... Doesn't the normal range from -1 to 1? I think it should be normal * 180.


Warner(Posted 2009) [#4]
If I remember properly, it should be:
first calculate yaw = atan2(x, z)
then correct the vector [x, y, z] so that it's yaw=0
then calculate pitch = atan2(y, z)


Knight #51(Posted 2009) [#5]
Thanks everybody :D