Quaternion vs Euler
02 February 2016 23:33
Hello. I am building a new project.
I took some control from Petigors tale and some from the fps jungle scene.
I control forward and backward from FPS with W and S. I use Q and E to rotate. I kept A and D for lateral translation for the moment. I may refactor that layout later.
But my problem is i try to parent the camera to the player with
m_cons.append_stiff_trans_rot(camobj, character, [0, 0.4, 0], [0.707, 0, 0, 0.707]);
But the camera never shows up the right way. I don't understand how to use the quaternion parameter and i am not confident if it really is XYZW or WXYZ(like in the propertys panel)
In the end I cleared rotation on the player and the camera but now the player goes backward with W…
I'm a bit confused.
I took some control from Petigors tale and some from the fps jungle scene.
I control forward and backward from FPS with W and S. I use Q and E to rotate. I kept A and D for lateral translation for the moment. I may refactor that layout later.
But my problem is i try to parent the camera to the player with
m_cons.append_stiff_trans_rot(camobj, character, [0, 0.4, 0], [0.707, 0, 0, 0.707]);
But the camera never shows up the right way. I don't understand how to use the quaternion parameter and i am not confident if it really is XYZW or WXYZ(like in the propertys panel)
In the end I cleared rotation on the player and the camera but now the player goes backward with W…
I'm a bit confused.
03 February 2016 17:09
But my problem is i try to parent the camera to the player with
m_cons.append_stiff_trans_rot(camobj, character, [0, 0.4, 0], [0.707, 0, 0, 0.707]);
It is better not to try constructing quaternions this way. I would go with a corresponding method for euler angles to quat conversation.
We have prepared an example for a similar question in another thread. I attached it to this message.
Another constraint type is used here. You will find it in the following line:
m_cons.append_semi_stiff_cam(camobj, character, offset);
04 February 2016 00:12