Compose complexe scenes by writing simple composition functions with support for live (shader) coding.
Asynchronous scene loading and setup uses promises and ensures that scenes down
the graph hierarchy are entirely loaded before they are inserted in parent
objects through the call to setup
.
Part of lucidity project.
npm install lucy-three --save
First declare sources by specifying a folder.
const compose = require ( 'lucy-compose' )
const fx = compose.load ( 'fx' )
// expects fx/cube/index.js or fx/cube.js to exist
fx ( 'cube' )
// same scene but with some additional options (these are passed right through
// to the scene's "setup" function).
fx
( 'cube'
, { distance: 5.0, extent: 1.0 }
)
Compose with postprocessing effect.
fx
( 'blur'
, { radius: 0.3 }
, fx ( 'cube' )
)
Transition between 'cube' and 'sphere' scenes using a 'fade' effect.
const trans = compose.load ( '../common/trans' )
fx
( 'fade'
, { position: 0.3 }
, fx
( 'blur'
, { radius: 0.8 }
, scene ( 'cube' )
)
, scene ( 'sphere' )
)
Look at the examples in 'examples' to get an idea of Scene definitions.
npm test
Please use 'jessy style'.
Add unit tests for any new or changed functionality.
- 0.2.0 (2015-09-22) Anaglyph renderer, better resizing support.
- 0.1.1 (2015-09-03) Fixed main module.
- 0.1.0 (2015-09-03) Initial release.