I have been giving it some thought and after several diagrams (more than I would like to admit), I think I have finally understood what you said.

Would it be something like this?:

(p)=point
(V)=vector

I'm still kind of stuck figuring out how to calculate how to rotate it...
-I assume the vector being rotated would be Real_Path=(Destination-Moving_Vehicle).
-And the rotation would be centered around Moving_Vehicle (giving me Temp_Path as the result).
-Then I could calculate Temp_Destination=(Moving_Vehicle+Temp_Path).

But I am still not sure how to calculate by how much I want Real_Path to be rotated.
And I am completely lost about the last step: how to calculate the local pan for Moving_Vehicle looking towards Temp_Destination

EDIT:
I think I got the first part figured out:
Code:
void look_at(ENTITY* Vehicle, VECTOR* Destination, ENTITY* Planet)
{
   VECTOR V_Nrml;
   VECTOR V_Path;
   ANGLE Rotation;
   

   //get our vehicle's normal to the planet
   vec_diff(V_Nrml,Vehicle.x,Planet.x);
   //get the direction to our destination
   vec_diff(V_Path,Destination,Vehicle.x);
   //translate the destination to our plane
   vec_to_angle(Rotation,V_Nrml);
   vec_rotateback(V_Path,Rotation);
   

   //make our vehicle look towards the new path
   //???
}}



Edit2:
Or mabe I'm just stuck cause I have not understood you correctly and am going in the wrong direction...

Last edited by Carlos3DGS; 01/15/12 18:26.

"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1