OK... i have been get the solution myself...
I send soon the source and the executable about basic path finding.
It is the example of code:
// --------------- function Dot, Magnitude and Angle
float Dot(vector3df vVector1, vector3df vVector2) {
// (V1.x * V2.x + V1.y * V2.y + V1.z * V2.z)
return ( (vVector1.X * vVector2.X) + (vVector1.Y * vVector2.Y) + (vVector1.Z * vVector2.Z) );
}
float Magnitude(vector3df vNormal){
return (float)sqrt( (vNormal.X * vNormal.X) + (vNormal.Y * vNormal.Y) + (vNormal.Z * vNormal.Z) );
}
double AngleBetweenVectors(vector3df Vector1, vector3df Vector2){
float dotProduct = Dot(Vector1, Vector2);
float vectorsMagnitude = Magnitude(Vector1) * Magnitude(Vector2) ;
double angle = acos( dotProduct / vectorsMagnitude );
return( angle);
}
//---------------------- and lather....
float vangle = AngleBetweenVectors(vigiapos, navepos);
vangle /= (PI / 180);
vector3df vrot = vigia->getRotation();
vrot.Y = vangle;
vigia->setRotation(vrot);
OKIS, OKIS.... HOUSTON
![Very Happy :D](./images/smilies/icon_biggrin.gif)