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 inpx
MODELS
— JS array with your compiled modelsMODELS_DATA
— JS array with parsed models data to be compiled and stored intoMODELS
TEXTURES
— JS array with compiled texturesTEXTURES_DATA
— JS array with images to be compiled and stored intoTEXTURES
RENDERER
&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 currentrequestAnimationFrame
call, 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.