3d Slope Maths

Blitz3D Forums/Blitz3D Programming/3d Slope Maths

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

----------------------- terrain height = 0

O
| O
| |
y1 y2

Not too sure if the above makes sense, but..

I've got this car which is facing to the right, the back wheel is at height y1 - the front wheel y2

As you can see its on a downwards slope, at the mo both points are below 0 on the terrain.

y1= -0.3465 y2= -0.4562

I'd like to work out the angle that I've got to rotate the car downwards. (x Axis) at the mo the car body is fixed to the back wheel - so I need to rotate the body to the angle of the slope.

I think I've got to use the Atan2 command, but I'm having problems with the result since its in the negative. (and counting down not up !)

Please Help !!!.