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 =;// 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
Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.