這是一個考你反應的遊戲
用你最快的速度去碰到畫面上隨機出現的球
import de.voidplus.leapmotion.*;
PImage img;
LeapMotion leap;
void setup() {
size(1600, 850, P3D);
leap=new LeapMotion(this);
}
void draw() {
img = loadImage("123.jpg");
background(255);
for (Hand hand : leap.getHands ()) {
hand.draw();
float angle=hand.getYaw();
PVector pos=hand.getPosition();
translate(pos.x, pos.y, pos.z);
rotateY(-radians(angle));
fill(0, 50, 100);
stroke(0);
image(img,0,0);
}
}
沒有留言:
張貼留言