PLEASE LOOK AT MY SOURCE CODE CAREFULLY
I have a car along with a matrix. I have created several rams/slopes on the matrix. I have managed to make my car go up the ramp, just not rotate properly. I have tried the folowing code:
Axtdif#=Ablypos#-Abrypos#
AOxtdif#=Axtdif#
if Axtdif#<0 then Axtdif#=ABS(Axtdif#)
Azrot#=atanfull(Axtdif#, Axsiz#)
if AOxtdif#<0 then Azrot#=0-Azrot#
Azrot#=wrapvalue(Azrot#)
zrotate object 1, Azrot#
And something similar for rotating it on the x axis. However, when I go up the ramp, my car rotates at a crazy angle. I have also tried:
`work out the different heights
frontHeight#=get ground height(<Matrix>,frontX#,frontZ#)
backHeight#=get ground height(<Matrix>,backX#,backZ#)
leftHeight#=get ground height(<Matrix>,leftX#,leftZ#)
rightHeight#=get ground height(<Matrix>,rightX#,rightZ#)
`Work out tilt values
xAng#=(backHeight#-frontHeight#)*6,object angle x(2),2
zAng#=(leftHeight#-rightHeight#)*6,object angle z(2),2
But that doesn't work. Why? And how can I solve this problem? I have tried to incorperate the source code from the tank demo but my car still rotates at a crazy angle.
While I'm showing you my source code, I'm hoping you can also help me with anouther problem. I'm having trouble trying to debug by code. Whenever I try use the text, print or center text commands, they do not work.
D.D.D Productions
Specializing in game creation