Esempio n. 1
0
 /**
  * Draws a 3-dimensional line from one point to another using the provided color and stroke
  * weight. Resets the stroke weight and color after drawing.
  *
  * @param start and end point of the line-segment.
  * @param end another end point of the line-segment.
  * @param color the color to make the line-segment.
  * @param strokeWeight the desired weight of the line to be drawn.
  */
 @Override
 public void drawLine(final Point start, final Point end, final Colors color, float strokeWeight) {
   this.setStrokeColorAndWeight(color, strokeWeight);
   this.applet.line(start.x, start.y, start.z, end.x, end.y, end.z);
   if (!wireMode) this.applet.noStroke();
   this.applet.color(Colors.BLACK.getRgb());
 }
Esempio n. 2
0
 /**
  * Draws a 3-Dimensional box onto the canvas whose center is the provided {@link Point} and whose
  * size (distance to a face from the center) is the provided size. Default box color is {@link
  * Colors#BLACK}.
  *
  * @param point the {@link Point} center of the box.
  * @param size the size (distance from center to faces) of the box an integer.
  */
 public void drawBox(final Point point, final int size) {
   if (wireMode) this.applet.stroke(wireframeColor.getRgb());
   else this.applet.noStroke();
   this.applet.pushMatrix();
   this.applet.fill(Colors.BLACK.getRgb());
   this.applet.translate(point.x, point.y, point.z);
   this.applet.box(size);
   this.applet.noFill();
   this.applet.popMatrix();
 }
Esempio n. 3
0
 /**
  * Draws a 3-Dimensional {@link Point} onto the canvas with a given radius. The default point
  * color is {@link Colors#BLACK}.
  *
  * @param point the {@link Point} to draw.
  * @param radius a radius, as a float.
  */
 public void drawPoint3D(final Point point, final float radius) {
   if (wireMode) this.applet.stroke(wireframeColor.getRgb());
   else this.applet.noStroke();
   this.applet.pushMatrix();
   this.applet.fill(Colors.BLACK.getRgb());
   this.applet.translate(point.x, point.y, point.z);
   this.applet.sphere(radius);
   this.applet.noFill();
   this.applet.popMatrix();
 }