SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
Exploring Color Spaces 
with Gesture Tracking and Smart Bulbs 
Daniel Luxemburg " 
@dluxemburg" 
Distill 2014
exploring-color-spaces/lifx1.rb 
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
require 
'lifx' 
client 
= 
LIFX::Client.lan 
client.discover 
while 
client.lights.count 
< 
1 
sleep(1) 
end 
puts 
"Found 
#{client.lights.count} 
light(s)" 
puts 
"Turning 
them 
on" 
client.lights.turn_on 
puts 
"Waiting 
5 
seconds" 
sleep(5) 
puts 
"Turning 
them 
off" 
client.lights.turn_off
#35879d 
rgb(53, 135, 157) 
3*16 + 5 = 53
exploring-color-spaces/lifx2.rb 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
puts "Found #{client.lights.count} light(s)” 
puts "Turning them on" 
client.lights.turn_on 
puts "Turning them teal" 
teal = LIFX::Color.rgb(53, 135, 157) 
client.lights.set_color(teal) 
puts "Waiting 5 seconds" 
sleep(5) 
puts "Turning them back to white and then off" 
white = LIFX::Color.rgb(255, 255, 255) 
client.lights.set_color(white) 
sleep(5) 
client.lights.turn_off
exploring-color-spaces/lifx3.rb 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
. 
//.. 
client.lights.turn_on 
Signal.trap("INT") { 
client.lights.turn_off 
exit 
} 
while raw = $stdin.gets 
numbers = raw.split(',').map(&:to_i) 
color = LIFX::Color.rgb(*numbers) 
client.lights.set_color(color) 
end
exploring-color-spaces/leap1.js 
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
var Leap = require('leapjs') 
var controller = new Leap.Controller() 
controller.on('frame', function(frame){ 
console.log(frame) 
}) 
controller.connect()
exploring-color-spaces/leap2.js 
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
var Leap = require('leapjs') 
var controller = new Leap.Controller() 
var lastFrameTime = 0 
controller.on('frame', function(frame){ 
if (Date.now() - lastFrameTime < 1000) return 
lastFrameTime = Date.now() 
var hands = frame.hands.map(function(hand){ 
delete(hand.frame) 
return hand 
}) 
console.log(frame.hands) 
}) 
controller.connect()
exploring-color-spaces/leap3.js 
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
var Leap = require('leapjs') 
var controller = new Leap.Controller() 
var mapPositionData = function(positions){ 
var ext = [[-240,240],[120,480],[-80,80]] 
return positions.map(function(p,i){ 
var n = (p - ext[i][0])/(ext[i][1] - ext[i][0]) 
return n < 0 ? 0 : (n > 1 ? 1 : (i == 2 ? 1 - n : n )) 
}) 
} 
//...
exploring-color-spaces/leap3.js 
12 
13 
14 
15 
16 
17 
18 
19 
20 
22 
23 
24 
25 
26 
27 
! 
! 
//.. 
var lastFrameTime = 0 
controller.on('frame', function(frame){ 
if (Date.now() - lastFrameTime < 250) return 
lastFrameTime = Date.now() 
if (frame.hands.length > 0) { 
var palmPosition = frame.hands[0].stabilizedPalmPosition 
var rgb = mapPositionData(palmPosition).map(function(n){ 
return Math.round(n*255) 
}) 
console.log(rgb.join(',')) 
} 
}) 
controller.connect()
exploring-color-spaces/lifx4.rb 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
//.. 
client.lights.turn_on 
Signal.trap("INT") { 
client.lights.turn_off 
exit 
} 
while raw = $stdin.gets 
args = raw.split(/,| /) 
space = args.first.to_sym 
args = args.slice(1,3).map(&:to_f) 
args.unshift(space) 
color = LIFX::Color.send(*args) 
puts "#{space}(#{args.slice(1,3).join(',')})" 
client.lights.set_color(color) 
end
exploring-color-spaces/leap4.js 
12 
13 
14 
15 
16 
17 
18 
19 
20 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
//.. 
var 
lastFrameTime 
= 
0 
controller.on('frame', 
function(frame){ 
if 
(Date.now() 
-­‐ 
lastFrameTime 
< 
250) 
return 
lastFrameTime 
= 
Date.now() 
if 
(frame.hands.length 
> 
0) 
{ 
var 
palmPosition 
= 
frame.hands[0].stabilizedPalmPosition 
var 
pl 
= 
frame.hands[0].pointables.length 
var 
space 
= 
[‘rgb','rgb','hsl','hsl','hsv','hsv'][pl] 
var 
multipliers 
= 
space 
== 
'rgb' 
? 
[255,255,255] 
: 
[360,1,1] 
var 
vals 
= 
mapPositionData(palmPosition).map(function(n,i){ 
return 
(n*multipliers[i]).toPrecision(3) 
}) 
console.log(space+" 
"+ 
vals.join(',')) 
} 
}) 
controller.connect()
“Enable us to build technology and 
interact with our peers, community 
and users in exciting new ways.”
Thanks!

Contenu connexe

Tendances

オープンデータを使ったモバイルアプリ開発(応用編)
オープンデータを使ったモバイルアプリ開発(応用編)オープンデータを使ったモバイルアプリ開発(応用編)
オープンデータを使ったモバイルアプリ開発(応用編)
Takayuki Goto
 
Data structure programs in c++
Data structure programs in c++Data structure programs in c++
Data structure programs in c++
mmirfan
 

Tendances (20)

Ns2: Introduction - Part I
Ns2: Introduction - Part INs2: Introduction - Part I
Ns2: Introduction - Part I
 
RxJS - The Reactive extensions for JavaScript
RxJS - The Reactive extensions for JavaScriptRxJS - The Reactive extensions for JavaScript
RxJS - The Reactive extensions for JavaScript
 
Multi qubit entanglement
Multi qubit entanglementMulti qubit entanglement
Multi qubit entanglement
 
OpenGL L06-Performance
OpenGL L06-PerformanceOpenGL L06-Performance
OpenGL L06-Performance
 
Quantum neural network
Quantum neural networkQuantum neural network
Quantum neural network
 
Generating and Analyzing Events
Generating and Analyzing EventsGenerating and Analyzing Events
Generating and Analyzing Events
 
The State of JavaScript
The State of JavaScriptThe State of JavaScript
The State of JavaScript
 
Inc decsourcefile
Inc decsourcefileInc decsourcefile
Inc decsourcefile
 
OpenGL Starter L01
OpenGL Starter L01OpenGL Starter L01
OpenGL Starter L01
 
Modern c++ Memory Management
Modern c++ Memory ManagementModern c++ Memory Management
Modern c++ Memory Management
 
Understanding the nodejs event loop
Understanding the nodejs event loopUnderstanding the nodejs event loop
Understanding the nodejs event loop
 
OpenGL Starter L02
OpenGL Starter L02OpenGL Starter L02
OpenGL Starter L02
 
Senior design project code for PPG
Senior design project code for PPGSenior design project code for PPG
Senior design project code for PPG
 
Functional Reactive Programming with RxJS
Functional Reactive Programming with RxJSFunctional Reactive Programming with RxJS
Functional Reactive Programming with RxJS
 
C c++-meetup-1nov2017-autofdo
C c++-meetup-1nov2017-autofdoC c++-meetup-1nov2017-autofdo
C c++-meetup-1nov2017-autofdo
 
The Ring programming language version 1.6 book - Part 25 of 189
The Ring programming language version 1.6 book - Part 25 of 189The Ring programming language version 1.6 book - Part 25 of 189
The Ring programming language version 1.6 book - Part 25 of 189
 
Rkf
RkfRkf
Rkf
 
オープンデータを使ったモバイルアプリ開発(応用編)
オープンデータを使ったモバイルアプリ開発(応用編)オープンデータを使ったモバイルアプリ開発(応用編)
オープンデータを使ったモバイルアプリ開発(応用編)
 
Better performance through Superscalarity
Better performance through SuperscalarityBetter performance through Superscalarity
Better performance through Superscalarity
 
Data structure programs in c++
Data structure programs in c++Data structure programs in c++
Data structure programs in c++
 

En vedette

Lighting design considerations
Lighting design considerationsLighting design considerations
Lighting design considerations
mominzaki
 

En vedette (12)

Color Theory
Color TheoryColor Theory
Color Theory
 
Color theory
Color theoryColor theory
Color theory
 
Illumination Lighting
Illumination LightingIllumination Lighting
Illumination Lighting
 
Illumination - Method of calculation
Illumination - Method of calculationIllumination - Method of calculation
Illumination - Method of calculation
 
Illumination.
Illumination.Illumination.
Illumination.
 
Lighting design considerations
Lighting design considerationsLighting design considerations
Lighting design considerations
 
INTERIOR LIGHTING DESIGN A STUDENT'S GUIDE
INTERIOR LIGHTING DESIGN A STUDENT'S GUIDEINTERIOR LIGHTING DESIGN A STUDENT'S GUIDE
INTERIOR LIGHTING DESIGN A STUDENT'S GUIDE
 
Color Powerpoint
Color PowerpointColor Powerpoint
Color Powerpoint
 
Lighting Powerpoint
Lighting PowerpointLighting Powerpoint
Lighting Powerpoint
 
Color theory part 2
Color theory part 2Color theory part 2
Color theory part 2
 
Color Theory - part 1
Color Theory - part 1 Color Theory - part 1
Color Theory - part 1
 
Types of Lighting and Luminaire
Types of Lighting and LuminaireTypes of Lighting and Luminaire
Types of Lighting and Luminaire
 

Similaire à Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)

Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 
Distributed Data Structures
Distributed Data StructuresDistributed Data Structures
Distributed Data Structures
PDX Web & Design
 

Similaire à Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014) (20)

Testing a 2D Platformer with Spock
Testing a 2D Platformer with SpockTesting a 2D Platformer with Spock
Testing a 2D Platformer with Spock
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the Horizon
 
Jan 2012 HUG: RHadoop
Jan 2012 HUG: RHadoopJan 2012 HUG: RHadoop
Jan 2012 HUG: RHadoop
 
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
 
Exactly once with spark streaming
Exactly once with spark streamingExactly once with spark streaming
Exactly once with spark streaming
 
You will learn RxJS in 2017
You will learn RxJS in 2017You will learn RxJS in 2017
You will learn RxJS in 2017
 
Monadologie
MonadologieMonadologie
Monadologie
 
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
 
Compact and safely: static DSL on Kotlin
Compact and safely: static DSL on KotlinCompact and safely: static DSL on Kotlin
Compact and safely: static DSL on Kotlin
 
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry PiMonitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Groovy puzzlers jug-moscow-part 2
Groovy puzzlers jug-moscow-part 2Groovy puzzlers jug-moscow-part 2
Groovy puzzlers jug-moscow-part 2
 
Distributed Data Structures
Distributed Data StructuresDistributed Data Structures
Distributed Data Structures
 
Rails-like JavaScript Using CoffeeScript, Backbone.js and Jasmine
Rails-like JavaScript Using CoffeeScript, Backbone.js and JasmineRails-like JavaScript Using CoffeeScript, Backbone.js and Jasmine
Rails-like JavaScript Using CoffeeScript, Backbone.js and Jasmine
 
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
 
Code
CodeCode
Code
 
Expert JavaScript tricks of the masters
Expert JavaScript  tricks of the mastersExpert JavaScript  tricks of the masters
Expert JavaScript tricks of the masters
 
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
 
Best Bugs from Games: Fellow Programmers' Mistakes
Best Bugs from Games: Fellow Programmers' MistakesBest Bugs from Games: Fellow Programmers' Mistakes
Best Bugs from Games: Fellow Programmers' Mistakes
 
Groovy puzzlers по русски с Joker 2014
Groovy puzzlers по русски с Joker 2014Groovy puzzlers по русски с Joker 2014
Groovy puzzlers по русски с Joker 2014
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Dernier (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)

  • 1. Exploring Color Spaces with Gesture Tracking and Smart Bulbs Daniel Luxemburg " @dluxemburg" Distill 2014
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. exploring-color-spaces/lifx1.rb 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 require 'lifx' client = LIFX::Client.lan client.discover while client.lights.count < 1 sleep(1) end puts "Found #{client.lights.count} light(s)" puts "Turning them on" client.lights.turn_on puts "Waiting 5 seconds" sleep(5) puts "Turning them off" client.lights.turn_off
  • 9. #35879d rgb(53, 135, 157) 3*16 + 5 = 53
  • 10. exploring-color-spaces/lifx2.rb 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 puts "Found #{client.lights.count} light(s)” puts "Turning them on" client.lights.turn_on puts "Turning them teal" teal = LIFX::Color.rgb(53, 135, 157) client.lights.set_color(teal) puts "Waiting 5 seconds" sleep(5) puts "Turning them back to white and then off" white = LIFX::Color.rgb(255, 255, 255) client.lights.set_color(white) sleep(5) client.lights.turn_off
  • 11. exploring-color-spaces/lifx3.rb 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 . //.. client.lights.turn_on Signal.trap("INT") { client.lights.turn_off exit } while raw = $stdin.gets numbers = raw.split(',').map(&:to_i) color = LIFX::Color.rgb(*numbers) client.lights.set_color(color) end
  • 12.
  • 13.
  • 14. exploring-color-spaces/leap1.js 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 var Leap = require('leapjs') var controller = new Leap.Controller() controller.on('frame', function(frame){ console.log(frame) }) controller.connect()
  • 15. exploring-color-spaces/leap2.js 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 var Leap = require('leapjs') var controller = new Leap.Controller() var lastFrameTime = 0 controller.on('frame', function(frame){ if (Date.now() - lastFrameTime < 1000) return lastFrameTime = Date.now() var hands = frame.hands.map(function(hand){ delete(hand.frame) return hand }) console.log(frame.hands) }) controller.connect()
  • 16. exploring-color-spaces/leap3.js 1 2 3 4 5 6 7 8 9 10 11 12 var Leap = require('leapjs') var controller = new Leap.Controller() var mapPositionData = function(positions){ var ext = [[-240,240],[120,480],[-80,80]] return positions.map(function(p,i){ var n = (p - ext[i][0])/(ext[i][1] - ext[i][0]) return n < 0 ? 0 : (n > 1 ? 1 : (i == 2 ? 1 - n : n )) }) } //...
  • 17. exploring-color-spaces/leap3.js 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 ! ! //.. var lastFrameTime = 0 controller.on('frame', function(frame){ if (Date.now() - lastFrameTime < 250) return lastFrameTime = Date.now() if (frame.hands.length > 0) { var palmPosition = frame.hands[0].stabilizedPalmPosition var rgb = mapPositionData(palmPosition).map(function(n){ return Math.round(n*255) }) console.log(rgb.join(',')) } }) controller.connect()
  • 18.
  • 19.
  • 20.
  • 21. exploring-color-spaces/lifx4.rb 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 //.. client.lights.turn_on Signal.trap("INT") { client.lights.turn_off exit } while raw = $stdin.gets args = raw.split(/,| /) space = args.first.to_sym args = args.slice(1,3).map(&:to_f) args.unshift(space) color = LIFX::Color.send(*args) puts "#{space}(#{args.slice(1,3).join(',')})" client.lights.set_color(color) end
  • 22.
  • 23. exploring-color-spaces/leap4.js 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 //.. var lastFrameTime = 0 controller.on('frame', function(frame){ if (Date.now() -­‐ lastFrameTime < 250) return lastFrameTime = Date.now() if (frame.hands.length > 0) { var palmPosition = frame.hands[0].stabilizedPalmPosition var pl = frame.hands[0].pointables.length var space = [‘rgb','rgb','hsl','hsl','hsv','hsv'][pl] var multipliers = space == 'rgb' ? [255,255,255] : [360,1,1] var vals = mapPositionData(palmPosition).map(function(n,i){ return (n*multipliers[i]).toPrecision(3) }) console.log(space+" "+ vals.join(',')) } }) controller.connect()
  • 24.
  • 25.
  • 26.
  • 27.
  • 28. “Enable us to build technology and interact with our peers, community and users in exciting new ways.”