How can I set camera FOV using three.js?

Hello!

In an 8th Wall project, I am using Three.js.
I have set the FOV for the Three.js camera, but it seems that fov value within a custom pipeline module does not take effect.
Does 8th Wall internally set the camera FOV? If so, is there a way to override these settings?

// not working
const { camera } = window.XR8.Threejs.xrScene()
camera.fov = 30
camera.updateProjectionMatrix()

Thank you!

Check out this thread I made: THREE.js camera aspect / FOV

You can probably override those settings as long as your code runs after the 8th Wall code that sets the projection matrix, but then you’ll probably experience tracking issues so better to find an alternative to changing FOV.

Thank you!
Yes, this is how I calculate FOV using camera intrinsics like you said in the thread.

// calculate FOV from intrinsics
onUpdate: ({ processCpuResult }) => {
  const { intrinsics } = processCpuResult.reality
  const b = intrinsics[5]
  const fovRad = 2 * Math.atan(1 / b)
  const fovDeg = THREE.MathUtils.radToDeg(fovRad)

  $cameraFov.set(fovDeg)
},