Offscreen canvas and orbit controls

Hi all.

I am trying to use the offscreen canvas in my 3d threejs based viewer.

One of my problems is that I don’t know how to interact with my scene with an orbitControls in the webworker thread.

As far as I know, webworkers cannot interact with dom objects.

Is there any workarraound for this?

Best regards

Only thing you need is the camera in your worker, so use the OrbitControls in your main thread and just snycrhonize the camera quaternion and world position with your thread.

I have found an example:

Best regards

1 Like

I wrote an example, you can view: