threejs-cljs-playground
threejs-cljs-playground copied to clipboard
three.js playground in ClojureScript
three.js playground in ClojureScript

The playground is running on bootstrapped ClojureScript and stores shared demos on Firebase.
Write some code, upload textures, OBJ/Collada models (more formats is coming soon) and hit Alt-Enter to evaluate and see results immediately.
After every evaluation the namespace is populated with the following vars:
THREE— three.js namespaceVIEWPORT— reference to canvas DOM elementWIDTH&HEIGHT— viewport dimensions inpxMODELS— JS array with your compiled modelsMODELS_DATA— JS array with parsed models data to be compiled and stored intoMODELSTEXTURES— JS array with compiled texturesTEXTURES_DATA— JS array with images to be compiled and stored intoTEXTURESRENDERER&CAMERA— assign your renderer and camera instances to these vars to let me handle window resizing for you...
(set! RENDERER renderer)
(set! CAMERA camera)
RAF— ID of the currentrequestAnimationFramecall, this is the important one...
Make sure you are always assigning returning value of requestAnimationFrame call to global RAF var, like this:
(set! RAF (js/requestAnimationFrame render))
This is required to drop current rendering loop before running a new one after each evaluation.