More or less working camera

This commit is contained in:
marcgauch committed 2023-12-15 08:40:48 +01:00
1 parent bc96207204
commit d4b6a3d42e
2 files changed
+179 -126

No files matched your search

@@ -71,29 +71,11 @@ public class WallArt : MonoBehaviour
// Update is called once per frame
void Update()
{
// https://www.youtube.com/watch?v=txF4t1qynyk
// Check if the cameraRig is assigned
if (ovrCameraRig == null) return;
// Get the CenterEyeAnchor position
Vector3 centerEyePosition = ovrCameraRig.centerEyeAnchor.position;
//Vector3 centerEyePosition = new Vector3();
// Update the position of the object based on the CenterEyeAnchor position with an added offset to the y-axis
///outsideCameraInstance.transform.position = new Vector3(centerEyePosition.x, centerEyePosition.y + 0f, centerEyePosition.z);
// Remove rotation around the z-axis
///Vector3 eulerRotation = ovrCameraRig.centerEyeAnchor.rotation.eulerAngles;
//Vector3 eulerRotation = Vector3.right;
///outsideCameraInstance.transform.rotation = Quaternion.Euler(eulerRotation.x, eulerRotation.y, 0f);
Vector3 localPlayer = window.InverseTransformPoint(centerEyePosition);
outsideCameraInstance.transform.position = window.TransformPoint(new Vector3(localPlayer.x, localPlayer.y, localPlayer.z));
Vector3 lookAtWindow = window.TransformPoint(new Vector3(-localPlayer.x, localPlayer.y, localPlayer.z));
outsideCameraInstance.transform.LookAt(lookAtWindow);
outsideCameraInstance.transform.position = ovrCameraRig.centerEyeAnchor.position;
outsideCameraInstance.transform.LookAt(window);
}
private void Log(string message)