Loss of object prototypes in web worker

63 views Asked by At

I have an algorithm that lets users enter equations and graphs them in three.js as a surface. Some of this data is large so I ship that work off to a web worker. The worker solves the equation and formats the needed items to show the three.js model.

However, creating the vertices and faces and then setting the color in the web worker seems like a moot point because the prototypes for the vertices, faces, and colors are lost when that data is sent back to the main program. This means that I have to re-loop through the data in the main algorithm to reset those prototypes.

Is this just something that I have to live with or is there a way to keep object prototypes when passing them back from a web worker?

0

There are 0 answers