an introducton to game programming with flash

13
An Introducton to Game Programming with Flash 4: Kinect

Upload: aji-saka

Post on 22-Feb-2017

56 views

Category:

Internet


1 download

TRANSCRIPT

Page 1: An introducton to game programming with flash

An Introducton to Game Programming with Flash

4: Kinect

Page 2: An introducton to game programming with flash

Kinect● Presented in 2009 (project Natal)

● Released in 2010

● The fastest-selling electronic gizmo of all tme● 8 million sold during first 60 days● 24 million sold so far*

● Over 120 games*

* Febuary 2013

Page 3: An introducton to game programming with flash

Sensors

● RGB Camera● 640x480 px

● Depth sensors● IR● CMOS sensor● Automatc calibraton based on gameplay, furnitures etc.

● Mult-array microphone● Ambient noise suppression

Page 4: An introducton to game programming with flash

Capabilites

● Full-body 3D moton capture● Tracking up to 6 people● 20 joints per player

● Facial recogniton

● Voice recogniton● Currently enabled in 11 countries

Page 5: An introducton to game programming with flash

Drivers

● Kinect for Windows SDK● Windows● http://kinectforwindows.org/

● Open NI Framework● Windows● Mac● http://www.openni.org/● https://code.google.com/p/simple-openni/

Page 6: An introducton to game programming with flash

AIR Kinect 2.0https://github.com/AS3NUI/airkinect-2-core

https://github.com/AS3NUI/airkinect-2-examples

Page 7: An introducton to game programming with flash

Initalizaton & Settings

var kinect:Kinect = Kinect.getDevice();

var settings:KinectSettings = new KinectSettings(); settings.rgbEnabled = true; settings.skeletonEnabled = true; settings.skeletonSmoothing = 0.8; kinect.start(settings);

1

2

Page 8: An introducton to game programming with flash

RGB Camera

var cameraBitmap:Bitmap = new Bitmap();addChild(cameraBitmap);

kinect.addEventListener(CameraImageEvent.RGB_IMAGE_UPDATE,

onCameraUpdate);

private function onCameraUpdate(event:CameraImageEvent): void { cameraBitmap.bitmapData = event.imageData; }

1

2

3

Page 9: An introducton to game programming with flash

Skeleton Joint

kinect.addEventListener(UserEvent.USERS_ADDED, onUserAdded); private function onUserAdded(event:UserEvent):void {

var user:User = event.users[0];

var joint:SkeletonJoint = user.getJointByName(SkeletonJoint.HEAD);

var headPt:Point = joint.position.depthRelative; }

1

2

3

4

Page 10: An introducton to game programming with flash

Jet&Giant

Page 11: An introducton to game programming with flash

git clone git://github.com/krzysztof-o/epi-wdpg.git

Jet&Giant

Page 12: An introducton to game programming with flash

Task 1Controlling Giant:● Giant's positon should be controlled using right hand

Page 13: An introducton to game programming with flash

Task 2Shootng Giant:● Giant should shoot after rising one's hand