Beispiel #1
0
 public void update() {
   rad += increment;
   if (rad > (Math.PI * 2)) {
     rad = 0.0;
   }
   coords[0] = 0.8 * Math.cos(rad);
   coords[1] = 0.8 * Math.sin(rad);
 }
Beispiel #2
0
 /* translate from 0 to 1, to a half circle
  * 0.0 = 0
  * 0.5 = 1
  * 1.0 = 0
  */
 private float halfCircle(float t) {
   return (float) Math.sin(t * 3.1415927f);
 }
Beispiel #3
0
 Sweep() {
   rad = 0;
   increment = 0.01;
   coords = new double[] {0.8 * Math.cos(rad), 0.8 * Math.sin(rad), 0.0};
   origin = new double[] {0.0, 0.0, 0.0};
 }