Libgdx tango project
Has anyone tried using libgdx for a tango project? I have a problem updating the camera based on the pose data. I am using the following code:
conversionQuaternion = new Quaternion(M_SQRT_2_OVER_2,
-M_SQRT_2_OVER_2, 0.0f, 0.0f); // This is used to convert from start
// of service coordinates to open gl
// coordinates quaternion
position.set((float) pose.translation[0], (float) pose.translation[2],
-(float) pose.translation[1]);
rotation.set((float) pose.rotation[0], (float) pose.rotation[1],
(float) pose.rotation[2], (float) pose.rotation[3]);
rotation.mulLeft(conversionQuaternion);
Assets.cam.up.set(0, 1, 0);
Assets.cam.direction.set(0, 0, -1);
Assets.cam.position.set(position);
Assets.cam.rotate(rotation);
Assets.cam.update();
+3
source to share
No one has answered this question yet
Check out similar questions: