Currently, I am developing a web application with Three.js that requires the use of equirectangular images for panoramic tours. My goal is to incorporate a feature that allows users to switch between normal mode and VR mode similar to React360 and AFrame. However, I prefer not to integrate React360 or AFrame into my existing application since it is already built around Three.js.
After reviewing various examples provided by Three.js, I noticed that none of them specifically address using an equirectangular image for VR purposes. Is there a method available to convert an equirectangular image to CubeMap format so that I can successfully implement this switching functionality between normal and VR modes?