sorry, but i have to say: this is bullshit grin

you can try something like this:

Code:
VECTOR front;
VECTOR back;
// Calculate front position
vec_set(front, vector(10, 0, 0)); // Distance 10 from model center
vec_rotate(front, vector(my.pan, 0, 0));
vec_add(front, my.x);
front.z += 100;

// Calculate back position
vec_set(back, vector(-10, 0, 0)); // Distance 10 from model center
vec_rotate(back, vector(my.pan, 0, 0));
vec_add(back, my.x);
back.z += 100;

var h1 = c_trace(back, vector(back.x, back.y, back.z - 200), IGNORE_ME | IGNORE_PASSABLE | ...);
var h2 = c_trace(front, vector(front.x, front.y, front.z - 200), IGNORE_ME | IGNORE_PASSABLE | ...);

var dist = h2 - h1;
my.tilt = atanv(dist / 20); // 20 is the distance between the front and the back vector before rotating and so



here i am calculating the height at the front and at the back of a model
the difference between both parts is the slope height
with arcus tangens you can convert the slope height into an angle you can use laugh

btw, code is not tested, also you have to correct the c_trace mode argument (i'm just simplified it.

greetz
Felix


Visit my site: www.masterq32.de