08-22-2017, 10:38 AM
Hi,
I am having some issue with the Oculus rift field of view. The thing is I'm not too sure if I needed the camera to follow the exact movements of the Oculus Rift sensors because Something was right about the field of view that the Oculus Rift displays. I thought that by making the camera follow the movements of the Oculus Sensors that it would fix the problem.
So I went ahead and made this snippet of code Inside an "update" method:
This makes it able (i think) to have the camera get the exact movement that the Oculus Rift has and copies it. But the problem isnt fixed. Its as if the culling mode or field of view or Something just interferes and i start losing the view of my terrain even when I get closer to it and whatever if the pitch/yaw/roll are positive or negative it doesnt change the fact that i lose the view of the terrain at angles I should normally be able to view it. So I know its probably me just not using the correct settings of the OVR or whatnot but if anyone has got any ideas on how to fix my problem i would really appreciate it?
thank you.
nine
I am having some issue with the Oculus rift field of view. The thing is I'm not too sure if I needed the camera to follow the exact movements of the Oculus Rift sensors because Something was right about the field of view that the Oculus Rift displays. I thought that by making the camera follow the movements of the Oculus Sensors that it would fix the problem.
So I went ahead and made this snippet of code Inside an "update" method:
Code:
bool latencyMark = false;
TrackingState trackState = _ovr.GetTrackingState(_oculusRiftVirtualRealityProvider.SessionPtr, 0.0f, latencyMark);
PoseStatef poseStatefer = trackState.HeadPose;
Posef hmdPose = poseStatefer.ThePose;
Quaternionf hmdRot = hmdPose.Orientation;
double roll = Math.Atan2(2 * hmdRot.Y * hmdRot.W + 2 * hmdRot.X * hmdRot.Z, 1 - 2 * hmdRot.Y * hmdRot.Y - 2 * hmdRot.Z * hmdRot.Z);
double pitch = Math.Atan2(2 * hmdRot.X * hmdRot.W + 2 * hmdRot.Y * hmdRot.Z, 1 - 2 * hmdRot.X * hmdRot.X - 2 * hmdRot.Z * hmdRot.Z);
double yaw = Math.Asin(2 * hmdRot.X * hmdRot.Y + 2 * hmdRot.Z * hmdRot.W);
_camera.Heading = yaw;
_camera.Attitude = pitch;
_camera.Bank = roll;This makes it able (i think) to have the camera get the exact movement that the Oculus Rift has and copies it. But the problem isnt fixed. Its as if the culling mode or field of view or Something just interferes and i start losing the view of my terrain even when I get closer to it and whatever if the pitch/yaw/roll are positive or negative it doesnt change the fact that i lose the view of the terrain at angles I should normally be able to view it. So I know its probably me just not using the correct settings of the OVR or whatnot but if anyone has got any ideas on how to fix my problem i would really appreciate it?
thank you.
nine

