Like this presentation? Why not share!

# Hacking the Kinect with GAFFTA Day 3

## by benDesigning on Mar 15, 2013

• 1,869 views

Day 3 of my workshop using open frameworks and c++ to use the kinect

Day 3 of my workshop using open frameworks and c++ to use the kinect

### Views

Total Views
1,869
Views on SlideShare
262
Embed Views
1,607

Likes
2
0
0

### 1 Embed1,607

 http://cargocollective.com 1607

## Hacking the Kinect with GAFFTA Day 3Presentation Transcript

• OPEN FRAMEWORKS + KINECT PART III @GAFFTAThursday, March 14, 13
• 3D and Open Frameworks Cameras 3D Math Classes OpenGL WrappersThursday, March 14, 13
• Vector Classes ofVec2f , ofVec3f , ofVec4f align() cross() distance() rotate() perpendicular() dot() vectors are used to store dimensional data such as position, direction, length ( or magnitude )Thursday, March 14, 13
• Quaternion Classes ofQuaternion With 3D rotation becomes more complicated rotating in X ,Y , and Z in different orders will result in different perceived rotations. Quaternions are used to calculate “moves” between rotations for consistency.Thursday, March 14, 13
• Matrices Classes ofMatrix3x3 , ofMatrix4x4 getRotate( ) getEuler( ) inverse( ) makeRotate( ) Matrices are often used to calculate 3d transformation data on a set of data to move things between coordinate spaces. Luckily of wraps a lot of this lower level functionality so these classes are more behind the scenes classes until you want to get really low level.Thursday, March 14, 13
• 3D Math ofWrapDegrees() ofRadToDeg( ) ofNoise( ) ofInsidePoly() ofRandom( ) Open Frameworks does a really good job of wrapping simple math functions that are often used when working with polygons angles and generative artThursday, March 14, 13
• Cameras Cameras is a great way to control how a 3D rendered scene looks. Cameras are the “eyes” of the window. The camera position has a large effect on rendered effects such as lights and shading. *HTTP://WWW.OPENFRAMEWORKS.CC/DOCUMENTATION/3D/OFCAMERA.HTML ofCamera - base camera class. Camera rendering is controlled similar to an ofFbo with ofCamera::begin() and ofCamera::end( ) ofEasyCam - extends ofCamera and adds a little extra functionality including mouse dragging functionality.Thursday, March 14, 13
• OpenGL OpenGL is an API for interactive directly with the GPU which is much more adept at handling parallel processing than the CPU. OpenGL is a very deep and extensive topic but the basics are wrapped well in Open Frameworks ofMesh - An ofMesh represents a set of vertices in 3D spaces, and normals at those points, colors at those points, and texture coordinates at those points. Each of these different properties is stored in a vector.Vertices are passed to your graphics card and your graphics card ﬁll in the spaces in between them in a processing usually called the rendering pipeline. The rendering pipeline goes more or less like this: *HTTP://WWW.OPENFRAMEWORKS.CC/DOCUMENTATION/3D/OFMESH.HTMLThursday, March 14, 13
• OpenGL ofNode - basic “3d” object class with position , rotation , and orientation. It also has some hand functions like : lookAt( ) which orients an ofNode object to any other ofNode object ofShader - shaders are small programs written in GLSL that allow for really intensive rendering computation. They are often split into two parts : the Vertex shader which works with vertices , and the Fragment shader which works with pixels. Shaders are a very deep topic but OF makes it easy to : load a shader from an external text ﬁle pass any data into the shader begin() and end() rendering. ofTexture - allows pixel data to be rendered on 3d vertices ofMaterial - contains properties for how textures are rendered such as shininess and color along with specular colorThursday, March 14, 13
• Kinect Point Cloud The kinect interprets the scene in 3D so it’s easy to work with the raw data. All you have have to do in OF is add it to an ofMesh and point an ofCamera at it.Thursday, March 14, 13
• ofxKinect + ofxUI + Point CloudThursday, March 14, 13
• Splicing the Point CloudThursday, March 14, 13