Nodejs is not supported threejs？ I want the server to render
That is not possible. Rendering is always frontend and need to be done by the client, because a Graphics Card is needed for rendering. You CAN set up a system to provide WebGL canvas for frontend.
you can combine this with headless rendering, puppeteer for instance.
three.js has no official support for
node.js however many setups work. For examples
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.
Wait a moment. So you telling me, that you can make screenshots from a 3D scene (canvas/div) from backend ? How do they do that? I thought that this is not possible.
I do not have the time to explain the approach in detail so I suggest you study the sources by yourself. You can find them here:
puppeteer.js contains the actual screenshot logic.