Ejemplo n.º 1
0
 private void drawUsingStrokeWeight(TherapeuticPresence _mainApplet) {
   _mainApplet.stroke(color, transparency);
   _mainApplet.noFill();
   _mainApplet.strokeWeight(strokeWeight);
   _mainApplet.beginShape();
   for (int i = 0; i < anchorPointsCounter - 1; i++) {
     if (i == 0) {
       _mainApplet.vertex(anchorPoints[i].x, anchorPoints[i].y, anchorPoints[i].z - zOffset);
     }
     _mainApplet.bezierVertex(
         controlPoints[i].x,
         controlPoints[i].y,
         controlPoints[i].z - zOffset,
         controlPoints[i].x,
         controlPoints[i].y,
         controlPoints[i].z - zOffset,
         anchorPoints[i + 1].x,
         anchorPoints[i + 1].y,
         anchorPoints[i + 1].z - zOffset);
   }
   _mainApplet.endShape();
 }
Ejemplo n.º 2
0
 private void drawUsingStrokeOffset(TherapeuticPresence _mainApplet) {
   _mainApplet.stroke(color, transparency);
   _mainApplet.noFill();
   for (float j = -strokeOffset; j <= strokeOffset; j += strokeOffset) {
     _mainApplet.beginShape();
     for (int i = 0; i < anchorPointsCounter - 1; i++) {
       if (i == 0)
         _mainApplet.vertex(anchorPoints[i].x, anchorPoints[i].y + j, anchorPoints[i].z - zOffset);
       _mainApplet.bezierVertex(
           controlPoints[i].x,
           controlPoints[i].y + j,
           controlPoints[i].z - zOffset,
           controlPoints[i].x,
           controlPoints[i].y + j,
           controlPoints[i].z - zOffset,
           anchorPoints[i + 1].x,
           anchorPoints[i + 1].y + j,
           anchorPoints[i + 1].z - zOffset);
     }
     _mainApplet.endShape();
     if (strokeOffset == 0) break;
   }
 }