Hey guys, thanks for your replies.
Hmm I currently want that cube rotates it's Y axis to the camera's Y axis only when I press the mouse's right button, I am updating the camera's position to get it around the character like this, with the famous sphericalXYZ function :
Code: Select all
vector3df sphericalXYZ(float compassAngle, float elevationAngle, float radius){
compassAngle = compassAngle * -1;
elevationAngle = elevationAngle * -1;
elevationAngle = elevationAngle + 90;
float x = radius * cos(compassAngle * PI/180.0f ) * sin(elevationAngle * PI/180.0f );
float z = radius * sin(compassAngle * PI/180.0f ) * sin(elevationAngle * PI/180.0f );
float y = radius * cos(elevationAngle * PI/180.0f );
vector3df result;
result.X = x;
result.Y = y;
result.Z = z;
return result;
}
But I don't really have any idea to get the Camera's Y rotation value to transmit it inside the cube, maybe with the target, I've already tried with getHorizontalAngle, I don't really understand how to use it...
Thanks for your help.