Kinect - Creating Hotpoints
in
Contributed Library Questions
•
5 months ago
I am having some trouble with the code I'm using while creating Hotpoints within my depthimage.. I get the error "cannot find a class or type named "Hotpoint"
What is my problem here? First error is at line 14. Any assistance will be appreciated! Thank you!
- import ddf.minim.*;
- import SimpleOpenNI.*;
- import processing.opengl.*;
- SimpleOpenNI kinect;
- float rotation = 0;
- Minim minim;
- AudioSnippet bongo1;
- AudioSnippet bongo2;
- Hotpoint bongoTrigger;
- Hotpoint bongoTwoTrigger;
- float s = 1;
- void setup(){
- size(1024, 768, OPENGL);
- kinect = new SimpleOpenNI(this);
- kinect.enableDepth();
- minim = new Minim(this);
- bongo1 = minim.loadSnippet("bongo.wav");
- bongo2 = minim.loadSnippet("bongo3.wav");
- //hotpoints origins and their size
- bongoTrigger = new Hotpoint (200, 0, 600, 150);
- bongoTwoTrigger = new Hotpoint (-200, 0, 600, 150);
- }
- void draw() {
- background(0);
- kinect.update();
- //PImage rgbImage = kinect.rgbImage();
- translate(width/2, height/2, -1000);
- rotateX(radians(180));
- translate(0,0,1400);
- rotateY(radians(map(mouseX, 0, width, -180, 180)));
- translate(0,0,s*-1000);
- scale(s);
- stroke(255);
- PVector[] depthPoints = kinect.depthMapRealWorld();
- //variable stores all points we find inside box on this frame
- for (int i = 0; i < depthPoints.length; i+=10) {
- PVector currentPoint = depthPoints[i];
- bongo1trigger.check(currentPoint);
- bongo2trigger.check(currentPoint);
- point(currentPoint.x, currentPoint.y, currentPoint.z);
- }
- println(bongoTrigger.pointsIncluded);
- if(!bongoTrigger.isPlaying()){
- bongo1.play();
- }
- if(!bongo1.isPlaying()){
- bongo1.rewind();
- }
- if(!bongoTwoTrigger.isPlaying()){
- bongo2.play();
- }
- if(!bongo2.isPlaying()){
- bongo2.rewind();
- }
- bongoTrigger.draw();
- bongoTrigger.clear();
- bongoTwoTrigger.draw();
- bongoTwoTrigger.clear();
- }
- void stop(){
- bongo1.close();
- bongo2.close();
- minim.stop();
- super.stop();
- }
- void keyPressed(){
- if (keyCode == 38){
- s = s +0.01;
- }
- if (keyCode == 40){
- s = s - 0.01;
- }
- }
1