Facing of a model
Posted: Mon Jul 18, 2005 6:22 pm
Hi all,
I'm currently working on getting my keyboard IO set up. Basically I have a 3rd person view and want my character to go foward when the forward key is pressed (usually w).
My problem now is in determining the direction in which the model is facing. I use to get a vector, based on the rotation of the mesh. But the model I use for testing (sydney) is built to have 0 rotation on her left, so if baciylly rotated 90 degrees clockwise.
The question I'm thinking about is: Is there a way to balance this "offset" without having to remember it for each model? Or is there a built-in function to get the "forwad" direction of a model?
Thanks for your answers!
I'm currently working on getting my keyboard IO set up. Basically I have a 3rd person view and want my character to go foward when the forward key is pressed (usually w).
My problem now is in determining the direction in which the model is facing. I use
Code: Select all
core::vector3df dir(sin(mesh->getRotation().Y * 3.14159/180.0f), 0, cos(mesh->getRotation().Y * 3.14159/180.0f) );
The question I'm thinking about is: Is there a way to balance this "offset" without having to remember it for each model? Or is there a built-in function to get the "forwad" direction of a model?
Thanks for your answers!