voxel-camera0.1.1 • Public • Published
A camera for voxeljs.
View the voxel-drone demo as it uses this camera.
// voxel-camera returns a method to create a camera controllervar createCameraControl = ;// Create a camera control, pass a copy of the gamevar cameraControl = ;// Add the camera to the scenegamescene;// Build a monitor (essentially a box to map the video screen to)var monitor =100 100 1map: cameraControl;// Add monitor mesh to the scenegamescene;// Then render the camera on tickgame;
If you need a marker on where the camera is set
var createCameraControl = ;var cameraControl = ;
If you would like to get a PNG stream from the camera:
var cameraControl = ;cameraControl;var img = document;cameraControl;
Warning: This uses
canvas.toDataURL('image/png') which is currently a really
expensive operation in the browser. Might want to consider throttling. If anyone
has a suggestion on a less expensive way, I'd love to hear it!
With npm do:
npm install voxel-camera
- 0.1.1 - convert into a stream and emit pngs :D
- 0.1.0 - initial release
Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.