while(1){
vec_diff(temp,p1.x,my.x); // get target(p1) and my angle
result = vec_to_angle(my_angle,temp);
rotate_speed = 0.5; // this will simulate a bit of inertia

if(my.pan<my_angle.pan){c_rotate(me,vector(rotate_speed,0,0),USE_AXIS|GLIDE);}
if(my.pan>my_angle.pan){c_rotate(me,vector(-rotate_speed,0,0),USE_AXIS|GLIDE);}
if(my.tilt<my_angle.tilt){c_rotate(me,vector(0,rotate_speed,0),USE_AXIS|GLIDE);}
if(my.tilt>my_angle.tilt){c_rotate(me,vector(0,-rotate_speed,0),USE_AXIS|GLIDE);}
if(my.roll<my_angle.roll){c_rotate(me,vector(0,0,rotate_speed),USE_AXIS|GLIDE);}
if(my.roll>my_angle.roll){c_rotate(me,vector(0,0,-rotate_speed),USE_AXIS|GLIDE);}


it works well, but.. sometimes it will go in a weird way, if angle becomes negative or positive..
i know that if angle is > 360 i can consider it 0 º but if <360 it can be 0 º too this will confuse the math here, i guess..

So i don't know if i should use relative or absolute rotation.. and if have to say pan%=360 or not :S



Last edited by MMike; 05/02/08 15:38.