object be oriented to another one only by the X and Z axis??

ric1234

29-11-2006 16:54:27

How do i make one object be oriented to another one only by the X and Z axis? i have one spider model that must be oriented ( aimed) to another character when it comes close, how do i do that? the distance between two i´ve already made by code.
//Tar_body is spider model in ODE
//dollFeetBody is character in ODE
//Calcular distancia entre aranha e PP
//
Vector3 p1 = Vector3(Tar_body->getPosition());
Vector3 p2 = Vector3(dollFeetBody->getPosition());
Vector3 p3 = p1 - p2;
float distancia;
distancia = ( p3.x * p3.x ) + ( p3.y * p3.y ) + ( p3.z * p3.z );
//
//fim - Calcular distancia entre aranha e PP
//
Now how do i do to the spider aim ( looking to) the character?

tuan kuranes

29-11-2006 17:23:32

Don't crosspost, please. It's indeed a OGRE only question.
Be sure to check wiki and forum search full of answer on that one.