You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Global vars seem to be the most convenient way to expose useful things to sketch authors. At the moment, we have THREE, POSTPROCESSING and GLSLIFY.
I'm also considering adding TWEEN for tween.js functionality. Eventually we might also want HEDRON for hedron specific utils (such as a Sketch class that can be extended, if we need to do this one day).
I'm slightly concerned we're really polluting the global namespace with all of the above and it gets hard to know what is available to a developer.
One simple approach would be to only expose one global var, HEDRON, and attach everything to that.
This is now implemented on the postprocessing branch. Going for a slightly deeper structure.
window.HEDRON={dependencies: {THREE: {
...THREE,// For convenience, also requiring some common three extras
GLTFLoader,
OrbitControls,},TWEEN,
postprocessing,
glslify,},}
Global vars seem to be the most convenient way to expose useful things to sketch authors. At the moment, we have
THREE
,POSTPROCESSING
andGLSLIFY
.I'm also considering adding
TWEEN
for tween.js functionality. Eventually we might also wantHEDRON
for hedron specific utils (such as aSketch
class that can be extended, if we need to do this one day).I'm slightly concerned we're really polluting the global namespace with all of the above and it gets hard to know what is available to a developer.
One simple approach would be to only expose one global var,
HEDRON
, and attach everything to that.Pros:
Cons:
The text was updated successfully, but these errors were encountered: