Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

Camera projection matrix to camera FOV conversion #483

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Assets/GoogleARCore/SDK/Scripts/ARCoreBackgroundRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ private void Update()
BackgroundMaterial.SetVector(bottomLeftRightVar,
new Vector4(uvQuad.BottomLeft.x, uvQuad.BottomLeft.y, uvQuad.BottomRight.x, uvQuad.BottomRight.y));

m_Camera.projectionMatrix = Frame.CameraImage.GetCameraProjectionMatrix(
var prjMat = Frame.CameraImage.GetCameraProjectionMatrix(
m_Camera.nearClipPlane, m_Camera.farClipPlane);

//Set camera FOV instead of setting camera projection matrix so other visual effects such as Post-Processing stack won't break
m_Camera.fieldOfView = Mathf.Atan(1 / prjMat[5]) * 2f * Mathf.Rad2Deg;
}

private void Disable()
Expand Down