Hi all,
I’m trying to change the scale of the rotation of the VR camera, based on the Oculus’ tracker. Eg, with a scale of 2.0, when I rotate my head 30 degrees, the camera should be rotated 60 degrees. I am currently only interested in yaw (look left/right). So far, I have been unable to implement it.
I worked with both OVRCameraRig and only a single camera with a script attached. The script just read the current eulerAngles of the camera’s rotation, multiply it by a fixed scale and set it again. However, it seems the camera ignores the new values. They appear in the debugger, but I do not see any difference. I tried the code in the preRender, preCull, lateUpdate methods with no effects.
The code looks like this:
void OnPreCull() {
float yaw = transform.eulerAngles[1];
yaw *= yawScale;
transform.rotation = Quaternion.Euler(0.0f, yaw, 0.0f);
}
Secondly, I tried rotating the scene opposite the rotation. However, that does not update the Skybox and the rotation also appeared jerky and certainly not smooth. I tried that in the update method.
Any tips and help would be much appreciated
I’ve been banging my head against this problem for the last 2 days.
Cheers!