I want to create a canvas in the backend and use three.js

I was looking for resources for that goal and found the file at that link.
WebGLBackend

I looked for examples or official documentation on how to use that file, but couldn’t find it.

If anyone knows how to use it, can you please reply?

Depends:

  1. What kind of backend?
  2. What would you like to do with said canvas, why would you need it on the server-side?

Puppeteer may be of some help. Just keep in mind - three.js overall is not really compatible with running on the server-side without applying magic here and there.

2 Likes

Hi @1_1

Do these links help?

https://webglsamples.org/

https://threejs.org/docs/#manual/en/introduction/WebGL-compatibility-check

I never tried to use it, but I will follow Your discoveries… :wink:

  1. node.js
  2. I want to take screenshots by rendering on a node.js backend server.
    I would like to print a photo of a rendered graphical model without using any of the user’s resources.

As far as I know, Three.js requires a browser environment. If you want to run three.js on a server you need a container that simulates a browser environment. I have to admit I have no idea about that because I’ve never dealt with it before.