Example: Live programming in Virtual Reality
functions
- console.log( msg ); - print a message to the window below the editor.
- put( objectA ).on( objectB )[.at( x, y, z )];
objectA: a THREE.Object3D to be added to another,
objectB: a THREE.Object3D where objectA will be added,
x, y, z: a location to set for objectA relative to objectB
- light( color [, intensity[, distance[, decay]]] );
creates a THREE.PointLight with the same parameters.
- brick( txtName );
creates a textured cube with the named texture, one of:
[SAND, WATER, ROCK, GRASS, DECK].
- quad( width[, height] );
creates a THREE.PlaneBufferGeometry with the same parameters.
if height is undefined, height is set to width (square).
- box( width[, height, length] );
creates a THREE.BoxGeometry with the same parameters.
if height is undefined, height and length are set to width (cube).
- hub( );
creates a raw THREE.Object3D. Useful for combining objects.
- sphere( radius[, slices, rings] );
creates a THREE.SphereGeometry with the same parameters.
- shell( radius[, slices, rings[, phi, theta]] );
creates a portion of the inside surface of a sphere.
- from( start ).to( end ).exec( thunk );
iterates on the range [start, end), passing the index as the parameter
to thunk, accumulating an array of thunk's return value.
- textured( geometry, txt[, options: { unshaded: false, wireframe: false, opacity: 1, txtRepeatS: 1, txtRepeatT: 1} ] );
geometry: a THREE.Geometry object
txt: a material definition of some kind. It could be a:
number - a solid hex color
string - a path to a texture image
Primrose.Text.Controls.TextBox - a text editor
unshaded: set to true to use constant lighting (default false)
opacity: 1 - opaque, 0 - transparent (default 1).
txtRepeatS: texture repeat in S direction (default 1).
txtRepeat: texture repeat in T direction (default 1).