voxel-camera
A camera for voxeljs.
View the voxel-drone demo as it uses this camera.
example
// 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 1 map: cameraControl ; // Add monitor mesh to the scenegamescene; // Then render the camera on tickgame;
If you need a marker on where the camera is set marker
to true
:
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!
install
With npm do:
npm install voxel-camera
release history
- 0.1.1 - convert into a stream and emit pngs :D
- 0.1.0 - initial release
license
Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.