dimanche 1 juillet 2018

Design pattern with three.js and webpack

I'm looking for a better way to organize my code with three.js and webpack than having everything in a single file (camera, meshes, lights, postprocessing, etc).

I thought I could use "manager modules" like a LightManager class, or a PostProcessingManager class, for instance. But then, these modules should be singletons, since I would only need one instance, right? Singleton is said to be a "bad" pattern, though (or you know, "it's not that it's bad, but in many cases you probably miss a better solution").

So I'm wondering what are my options? How do you guys organize your code?

Aucun commentaire:

Enregistrer un commentaire