three-world
Convenience wrapper around Three.js to create a scene, camera and renderer quickly
Simple sample
var world = geometry = 10 10 10 material = color: 0xff0000 mesh = geometry material; { meshrotationy += 005; } world; world; worldstart;
You can also pause
and resume
the world, if you so wish:
worldstart; ... world; console; world;
In addition you can get the Camera, Scene and Renderer:
var cam = world scene = world renderer = world;
Available options
Option | Description | Default |
---|---|---|
ambientLightColor | Color of the ambient light. Optional. | 0xffffff (white) |
camDistance | Position on the z-axis where the camera should initially be. Optional. | 100 |
clearColor | Color that is used to clear the canvas. Optional. | 0 (black) |
container | Element that the renderer should be appended to. Optional. | document.body |
farPlane | Maximum distance from the camera that is still rendered. Optional. | 2000 |
renderCallback | Callback function that is called right before rendering a new frame. Optional | undefined |