# How can I set camera FOV using three.js?

**URL:** <https://forum.8thwall.com/t/how-can-i-set-camera-fov-using-three-js/1822>\
**Category:** Technical Support\
**Tags:** threejs\
**Created:** [June 25, 2024, 5:55am UTC](https://forum.8thwall.com/t/how-can-i-set-camera-fov-using-three-js/1822 "2024-06-25T05:55:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kazuho\_Ishida](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@Kazuho\_Ishida](https://forum.8thwall.com/u/Kazuho_Ishida)\
**Post date:** [June 25, 2024, 5:55am UTC](https://forum.8thwall.com/t/how-can-i-set-camera-fov-using-three-js/1822/1 "2024-06-25T05:55:48Z")

</div>

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?

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

```

Thank you!

---

<div class="post-metadata">

**Author:** ![Arthur\_Sangouard1](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@Arthur\_Sangouard1](https://forum.8thwall.com/u/Arthur_Sangouard1)\
**Post date:** [December 17, 2024, 2:51pm UTC](https://forum.8thwall.com/t/how-can-i-set-camera-fov-using-three-js/1822/2 "2024-12-17T14:51:44Z")

</div>

Check out this thread I made: [THREE.js camera aspect / FOV](https://forum.8thwall.com/t/three-js-camera-aspect-fov/3988)

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.

---

<div class="post-metadata">

**Author:** ![Kazuho\_Ishida](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@Kazuho\_Ishida](https://forum.8thwall.com/u/Kazuho_Ishida)\
**Post date:** [December 18, 2024, 6:24am UTC](https://forum.8thwall.com/t/how-can-i-set-camera-fov-using-three-js/1822/3 "2024-12-18T06:24:26Z")

</div>

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

```auto
// 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)
},

```
