Rendering from two cameras at the same time in A-Frame

Solution 1:

While there may be a better or cleaner way to do this in the future, I was able to get a second camera rendering by looking at examples of how this is done in the THREE.js world.

I add a component to a non-active camera called spectator. in the init function I set up a new renderer and attach to div outside the scene to create a new canvas. I then call the render method inside the tick() part of the lifecycle.

I have not worked out how to isolate the movement of this camera yet. The default look controls of the 0.3.0 aframe scene still control both camera

gif of spectator cam

Source code: https://gist.github.com/derickson/334a48eb1f53f6891c59a2c137c180fa