configure UI and more leapmotion examples

This commit is contained in:
Sam 2023-07-19 23:05:06 +02:00
parent 9b0c8ffc86
commit ebe188592e
4 changed files with 392 additions and 1 deletions

View file

@ -8,7 +8,7 @@ int rgb2int(int r, int g, int b) {
}
void setup() {
size(640, 360);
size(400, 200);
noStroke();
rectMode(CENTER);
}
@ -29,6 +29,7 @@ void draw() {
points.add(new PVector(mouseX-rect1Width/2, height/2-rect1Height/2));
points.add(new PVector(mouseX+rect1Width/2, height/2-rect1Height/2));
points.add(new PVector(mouseX+rect1Width/2, height/2+rect1Height/2));
points.add(new PVector(mouseX-rect1Width/2, height/2+rect1Height/2));
points.add(new PVector(mouseX-rect1Width/2, height/2-rect1Height/2));
// Draw second rectangle using lines
int inverseX = width-mouseX;
@ -43,6 +44,7 @@ void draw() {
points.add(new PVector(inverseX+rect2Width/2, height/2-rect2Height/2));
points.add(new PVector(inverseX+rect2Width/2, height/2+rect2Height/2));
points.add(new PVector(inverseX-rect2Width/2, height/2+rect2Height/2));
points.add(new PVector(inverseX-rect2Width/2, height/2-rect2Height/2));
if (points.size() > 0) {
println("point size : "+points.size());
println("pointlist");