We are about to switch to a new forum software. Until then we have removed the registration on this forum.
import com.leapmotion.leap.*;
int width = 800; int height = 600; color canvasColor = 0x000000; float turns = radians(360); float xRotation = 0; float yRotation = 0; Controller leap = new Controller();
void setup() { frameRate(120); size(800, 600, P3D); background(canvasColor); }
void draw(){ Frame frame = leap.frame(); Hand hand = frame.hands().frontmost(); if( hand.isValid() ) { InteractionBox box = frame.interactionBox(); Vector controlPosition = hand.palmPosition(); Vector normalizedPosition = box.normalizePoint(controlPosition, false); xRotation = turns * normalizedPosition.getX(); yRotation = turns * (1 - normalizedPosition.getY()); } background(canvasColor); translate(width/2, height/2); rotateZ(xRotation); rotateX(yRotation);
box(200); }
now I make a interaction stuff with Leap motion. I don't know how to replace the InteractionBox by a text (or words, e.g. apple)