How to create an optically-inverted (mirror-image) camera in Three.js?

Hi, does anyone know how I can get a whole three.js scene to flip like a mirror image by possibly inverting the camera?

I’ve attached an image to show what I am trying to achieve. I want to flip the entire scene and not just one specific object. I’m also using a stereo rendering effect if that matters.

I’m pretty sure it won’t work to invert with the Camera. You can try it: copy the source code of PerspectiveCamera (https://github.com/mrdoob/three.js/blob/7c1424c5819ab622a346dd630ee4e6431388021e/src/cameras/PerspectiveCamera.js) and change updateProjectionMatrix to flip it using scale(-1, 1, 1).

The problem is I think this will turn all your objects inside-out! Think what happens to a polygon face if you flip the X coordinates: the face normal will point the opposite direction. Could still work fine if you don’t mind setting all your materials to THREE.DoubleSide.

Otherwise, instead of using the camera you could try a WebGL mirror; see the source of https://threejs.org/examples/webgl_mirror.html