Getting a angle for an entity relative to a surface normal it has collided with?

Blitz3D Forums/Blitz3D Programming/Getting a angle for an entity relative to a surface normal it has collided with?

Craig is helping me with this thing. So far I have this:

TFormVector Nx,Ny,Nz,0,car
Nx = TFormedX()
Ny = TFormedY()
Nz = TFormedZ()

carpitch# = -(VectorPitch(Nx,Ny,Nz)+90) ;+90 to make car sit upright

RotateEntity car,carpitch,EntityYaw(car),0


With this the car will angle correctly going up a ramp... but coming back down the other side it angles itself on the pitch as if it's going up the ramp (even though it's heading down the ramp). The value we are getting back from the carpitch is the same going up the ramp as it is going down... don't know why?