Code Monkey home page Code Monkey logo

three-kinectron's Introduction

Kinectron for Three.js

A plugin for working with Kinectron streams in Three.js

  1. Usage
  2. Contribute Kinectron

Usage

You can create geomtery from the Kinect's depth feed by simply:

var kinectGeo = THREE.KinectronGeometry("mesh");

You can choose the rendering type by changing the first argument to "mesh" / "wire" / "points"

And then simply add it your Three.js scene:

scene.add(kinectGeo);

You would need to also bind the incoming Kinect image to the '''kinectGeo''' instance

function onNewKinectFrame(ktronImg) {
	kinectronGeo.kinectron.bind(ktronImg.src);
}

For further reference use the simple example

Class methods:

  • kinectGeo.setDisplacement(amount) - Increase or decrease the amount of displacement on the Z axis (Default value is 1.0).
  • kinectGeo.setBrightness(amount) - Increase or decrease the brightness of the texture (Default value is 0.0).
  • kinectGeo.setContrast(amount) - Increase or decrease the contrast of the texture (Default value is 1.0).
  • kinectGeo.setOpacity(opacity) - Increase or decrease the opacity of the texture (Default value is 1.0).
  • kinectGeo.setPointSize(opacity) - Increase or decrease the point size (Only when rendering points, "points").
  • kinectGeo.setLineWidth(width) - Increase or decrease the line width (Only when rendering wireframe, "wire").
  • kinectGeo.pause() - Pause the rendering of the Kinectron stream, keeps the last frame.
  • kinectGeo.play() - Resume the rendering of the Kinectron stream.
  • kinectGeo.bind(imageStream) - Bind a Kinectron image stream to the material, needs to be called everytime a new frame arrives.
  • kinectGeo.update() - Calling the update method in the render loop will update the time uniform in the shader.

Contribute

Fork/Clone the repository, make sure to use the --recursive flag when you clone to clone submodules too, and npm install all dependencies

Build system commands:

  • npm run start uses concurrently to run both an http-server and a watchify build opreation on every save to dist/kinectron.three.js.
  • npm run build builds a minified version of the plugin once and saves it to dist/kinectron.three.min.js

Written by juniorxsound based on DepthKit.js as a part XStory grant in ITP, NYU

three-kinectron's People

Contributors

juniorxsound avatar lisajamhoury avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.