Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roman01la/threejs-cljs-playground
three.js playground in ClojureScript
https://github.com/roman01la/threejs-cljs-playground
clojurescript playground threejs webgl
Last synced: 2 months ago
JSON representation
three.js playground in ClojureScript
- Host: GitHub
- URL: https://github.com/roman01la/threejs-cljs-playground
- Owner: roman01la
- Created: 2015-08-15T00:51:39.000Z (over 9 years ago)
- Default Branch: gh-pages
- Last Pushed: 2019-01-30T14:17:43.000Z (almost 6 years ago)
- Last Synced: 2024-05-02T04:40:56.253Z (9 months ago)
- Topics: clojurescript, playground, threejs, webgl
- Language: CSS
- Homepage: http://roman01la.github.io/threejs-cljs-playground/
- Size: 7.13 MB
- Stars: 44
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# three.js playground in ClojureScript
![demo](screenshot.jpg)
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 namespace
- `VIEWPORT` — reference to canvas DOM element
- `WIDTH` & `HEIGHT` — viewport dimensions in `px`
- `MODELS` — JS array with your compiled models
- `MODELS_DATA` — JS array with parsed models data to be compiled and stored into `MODELS`
- `TEXTURES` — JS array with compiled textures
- `TEXTURES_DATA` — JS array with images to be compiled and stored into `TEXTURES`
- `RENDERER` & `CAMERA` — assign your renderer and camera instances to these vars to let me handle window resizing for you...```clojurescript
(set! RENDERER renderer)
(set! CAMERA camera)
```- `RAF` — ID of the current `requestAnimationFrame` call, this is the important one...
Make sure you are always assigning returning value of `requestAnimationFrame` call to global `RAF` var, like this:
```clojurescript
(set! RAF (js/requestAnimationFrame render))
```This is required to drop current rendering loop before running a new one after each evaluation.