public CamMover(TagExplorerProcessing2 p5, int x, int y, int chooserH) { super(x, y); this.p5 = p5; h = 36; w = h * 2; this.x = x; this.y = y - h; // startY // + p5.timeline.mapExpCam(p5.cam_eyetargetpos.z - (p5.height / 2.0f) // / p5.tan(PConstants.PI * 30.0f / 180.0f), h) - hFeld; minY = this.y - chooserH; maxY = this.y; // MinTime Feld mover = p5.createShape(); mover.fill(p5.cTagDark); mover.noStroke(); mover.vertex(0 + h, 0); mover.vertex(0 + w, 0); mover.vertex(0 + w, h); mover.vertex(0, h); mover.end(); }
// ------------------------------------------- public PShape createForm() { PShape s = createShape(); s.beginShape(); s.noStroke(); s.fill(0xffFF5757); for (PVector p : pointForm) s.curveVertex(p.x, p.y); // TO CLOSE THE FORM s.curveVertex(pointForm.get(0).x, pointForm.get(0).y); s.curveVertex(pointForm.get(1).x, pointForm.get(1).y); s.curveVertex(pointForm.get(2).x, pointForm.get(2).y); s.endShape(); return s; }
// ----------------------------------------------- public PShape simpleLeaf(float ratio) { PShape s = createShape(); s = createShape(); s.beginShape(); s.fill(c); s.noStroke(); s.rotate(angle); s.curveVertex(0, 0); s.curveVertex(0, 0); s.curveVertex(30, -50); s.curveVertex(0, -100); s.curveVertex(-30, -50); s.curveVertex(0, 0); s.curveVertex(0, 0); s.scale(ratio); s.endShape(); return s; }
// ----------------------------------------------- public PShape complexLeaf() { PShape s = createShape(); s.beginShape(); s.fill(0xffFF5757); s.noStroke(); s.scale(ratio); s.rotate(angle); // First point s.curveVertex(skeleton.position.get(0).x, skeleton.position.get(0).y); s.curveVertex(skeleton.position.get(0).x, skeleton.position.get(0).y); // Middle points for (int i = 1; i < skeleton.position.size() - 1; i++) { float x = skeleton.position.get(i).x; float y = skeleton.position.get(i).y; float a = skeleton.angle.get(i); ; x += cos(a - angleVeins) * sizeVeins; y += sin(a - angleVeins) * sizeVeins; s.curveVertex(x, y); Veins v = new Veins(skeleton.position.get(i), new PVector(x, y)); veins.add(v); } // Peak point s.curveVertex( skeleton.position.get(skeleton.position.size() - 1).x, skeleton.position.get(skeleton.position.size() - 1).y); // Return Middle points for (int i = skeleton.position.size() - 2; i >= 1; i--) { float x = skeleton.position.get(i).x; float y = skeleton.position.get(i).y; float a = skeleton.angle.get(i); x += cos(a - PI + angleVeins) * sizeVeins; y += sin(a - PI + angleVeins) * sizeVeins; s.curveVertex(x, y); Veins v = new Veins(skeleton.position.get(i), new PVector(x, y)); veins.add(v); } // Last point s.curveVertex(skeleton.position.get(0).x, skeleton.position.get(0).y); s.curveVertex(skeleton.position.get(0).x, skeleton.position.get(0).y); s.endShape(); return s; }