Posted: 24th Dec 2002 13:55
function matrixAngleX(mat,x#,z#,fluid)
if fluid =
Posted: 24th Dec 2002 22:15
whoops
Posted: 25th Dec 2002 0:23
what the hell is going on here??
Posted: 26th Dec 2002 11:34
sorry, I don't know why it didnt post all... I hope that it will work now :

+ Code Snippet
function matrixAngleX(mat,x#,z#,fluid) 
if fluid < 1 then fluid = 1
hauteur1# = get ground height(mat,x#,z#+fluid) 
hauteur2# = get ground height(mat,x#,z#-fluid) 
diffhauteur# = hauteur2# - hauteur1# 
angle# = asin((diffhauteur# / (2*fluid))) 
angle# = wrapvalue(angle#) 
endfunction angle# 

function matrixAngleZ(mat,x#,z#,fluid) 
if fluid < 1 then fluid = 1
hauteur1# = get ground height(mat,x#+fluid,z#) 
hauteur2# = get ground height(mat,x#-fluid,z#) 
diffhauteur# = hauteur2# - hauteur1# 
angle# = asin((diffhauteur# / (2*fluid))) 
angle# = wrapvalue(angle#) 
endfunction angle# 


for the two snippets, you have to give 3 informations :
1. the position X
2. the position Z
3. the smooth ( fluid in my snippet because smooth is "fluidité" in french )
and the snippet gives back theorientation of the area of the matrix at the coordinates X and Z.
what does smooth ? I try to explain well in english, but it won't be well ^^
If you use those function to set a truck to the matrix orientation, if the truck is between two tiles, you have two choices : it's orientation change suddently, or it's orientation change slowly.
if you want that it change slowly, give a high value for smooth, else give a small value.
hmm I tried to explain it better in my first post, but I'm sure that you know how work arcsinus
my snippet isn't hard to understand, but it work well ^^

P.S.: I hope that it will poste all
Posted: 12th Aug 2003 22:24
could you give an example of how to use it?
sorry if i'm dragging this up but lots of people have been asking