5

Does anyone know how to create a 360º camera in three.js?

I'm trying to render the entire scene as a 360º panorama like you would with a go pro 360 rig.

I'm trying to recreate a panorama by arranging several screens in a circle and stretch a threejs window across all the screens.

For this I need a very wide window that has a tree.js camera that captures the entire scene in 360º

Is this possible?

1
  • here there. Did you ever get this working in realtime? what was the performance like? Dec 1, 2019 at 8:34

2 Answers 2

3

It is definitely possible, as it was already implemented: https://github.com/spite/THREE.CubemapToEquirectangular

That library will just export snapshots as png, but looking at the code it should be possible to integrate the same method it uses into realtime-rendering if you want to...

2
  • Thanks, this is very interesting! Feb 4, 2017 at 19:48
  • 1
    Doesnt seem to work in threejs 103. There are a number of new changes to cubeCamera and THREE.WebGLRenderTargetCube (no longer called this, and you need to be careful of shadows and clearing buffers). Apr 26, 2020 at 13:44
3

You can't represent a 360-degree view with a conventional view matrix. You need to render to a set of textures (e.g. the six faces of a cube) then combine them into a 360 degree mapping such as equirectangular.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.