This example renders thirty frames of the Three.js 'your first scene' example and sends them to a Node.js microservice, which saves them to the filesystem.
test-render-client.html
- Creates the scene, camera, renderer, and kicks off the render loop, which stops after 30 frames have been rendered.
- As an optimization, it doesn't add the Three.js canvas to the browser DOM, rendering it offscreen, but reporting progress.
- It extracts the data for each frame using canvas.toDataURL(), sending that to a web worker process for transmission.
- When all frames are rendered, it sends a 'done' message to the worker.
test-render-worker.js
- Sets up a queue for incoming frames to be sent to the server.