Skip to content

Ramshackle-Jamathon/rollin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keep Rollin'

Keep Rollin'

Installation

$ npm install keep-rollin

Usage

var Webcam = require("keep-rollin");

var webcam = new Webcam({
	minWidth: 1920, // default: 1280
	minHeight: 1080, // default: 720
	minFrameRate: 30, // default: 60
});

var webcamTexture;
function renderLoop(){
	if(webcam.video.readyState === webcam.video.HAVE_ENOUGH_DATA) {
		if(webcamTexture) {
			webcamTexture.setPixels(webcam.video);
		} else {
			webcamTexture = funcThatMakesATextureFromAStream(webcam.video);
		} 
		this.shader.uniforms.uWebcamTexture = this.webcamTexture.bind();
	}
	/*

		...doing neat things

	*/
	window.requestAnimationFrame(renderLoop);
}
window.requestAnimationFrame(renderLoop);

Badges

About

Keep Rollin' that webcam with getUserMedia

Resources

License

Stars

Watchers

Forks

Packages

No packages published