I totally understand that three.js is a client side, but want to confirm if it reachable to have an animation into a video or lets say images using server side?
You can use three.js
to render applications on node.js. There are several discussion about this topic like this one:
three.js has no official support for node.js however many setups work. For examples three.js uses node.js for generating screenshots from all official examples in context of E2E testing.
Like with any other WebGL content it’s important to run your code in an appropriate environment. The mentioned puppeteer project is a good start.
three.js
can’t directly render a video for you but you can do it by yourself by using a library like FFmpeg
. That is how the editor does it:
for ( let i = 0; i < frames; i ++ ) {
player.render( currentTime );
const num = i.toString().padStart( 5, '0' );
ffmpeg.FS( 'writeFile', `tmp.${num}.png`, await fetchFile( canvas.toDataURL() ) );
currentTime += 1 / fps;
progress.setValue( ( i / frames ) * 0.5 );
}