text 旋转圈在progress.pde
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 旋转圈在progress.pde相关的知识,希望对你有一定的参考价值。
float[] time = new float[0];
float[][] wave = new float[0][0];
float[] wave1 = new float[0];
float[] wave2 = new float[0];
float[] wave3 = new float[0];
float[] wave4 = new float[0];
float[] wave5 = new float[0];
float[] wave6 = new float[0];
float[] wave7 = new float[0];
float[] wave8 = new float[0];
float[] wave9 = new float[0];
float[] x = new float[0];
float[] y = new float[0];
float gridx = 1000/3;
float gridy = 1000/3;
float distance = 1000/3;
int gridNumber = 3;
//float timeup = random(0, 0.1);
float timeup1 = 0.05;
float timeup2 = timeup1 *3.5;
float timeup3 = 0.05;
float timeup4 = timeup1 *3.5;
float timeup5 = 0.05;
float timeup6 = timeup1 *3.5;
float timeup7 = 0.05;
float timeup8 = timeup1 *3.5;
float timeup9 = 0.05;
void setup() {
size(1000, 1000);
ellipseMode(CENTER);
//noLoop();
// Define Time
/* can get rid of these if the time[] array works
float time1 = 0;
float time2 = 0;
float time3 = 0;
float time4 = 0;
float time5 = 0;
float time6 = 0;
float time7 = 0;
float time8 = 0;
float time9 = 0;
can get rid of these if the x[] and y[] arrays work
float x1 = 0;
float y1 = 0;
float x2 = 0;
float y2 = 0;
float x3 = 0;
float y3 = 0;
float x4 = 0;
float y4 = 0;
float x5 = 0;
float y5 = 0;
float x6 = 0;
float y6 = 0;
float x7 = 0;
float y7 = 0;
float x8 = 0;
float y8 = 0;
float x9 = 0;
float y9 = 0;
*/
// sets all parts of the time[] array to 0
for(int i=0;i<10;i++)
{
time[i]=0;
}
// sets all parts of the x[] and y[] arrays to 0
for(int i=0;i<10;i++)
{
x[i]=0;
y[i]=0;
}
}
void draw() {
background(0);
float radius = 100;
stroke(255);
noFill();
ellipse(100,width/2,radius*2, radius*2);
ellipse( width/2, 100, radius*2, radius*2);
/* can delete if the x,y and time arrays work
x1 = radius * cos(time1);
y1 = radius * sin(time1);
x2 = radius * cos(time2);
y2 = radius * sin(time2);
x3 = radius * cos(time1);
y3 = radius * sin(time1);
x4 = radius * cos(time2);
y4 = radius * sin(time2);
x5 = radius * cos(time1);
y5 = radius * sin(time1);
x6 = radius * cos(time2);
y6 = radius * sin(time2);
x7 = radius * cos(time1);
y7 = radius * sin(time1);
x8 = radius * cos(time2);
y8 = radius * sin(time2);
x9 = radius * cos(time1);
y9 = radius * sin(time1);
*/
for(int i=0;i<10;i++)
{
myArray[i]=i; //loop through the remaining 98 elements.
x[i] = radius * cos(time[i]);
y[i] = radius * sin(time[i]);
}
//maybe need to turn the wave arrays into a single 2d array and fit the below lines into the for loop
for(int i=0;i<10;i++)
{
wave[i] = splice(wave[i], y[i], 0);
// somehow got to figure out this alternating x and y situation
}
wave1 = splice(wave1, y1, 0);
wave2 = splice(wave2, x2, 0);
wave3 = splice(wave3, y1, 0);
wave4 = splice(wave4, x2, 0);
wave5 = splice(wave5, y1, 0);
wave6 = splice(wave6, x2, 0);
wave7 = splice(wave7, y1, 0);
wave8 = splice(wave8, x2, 0);
wave9 = splice(wave9, y1, 0);
beginShape();
for (int i = 0; i < wave1.length; i++) {
//vertex(i+100, wave1[i]+width/2);
vertex(wave2[i]+width/2, wave1[i]+width/2);
}
endShape();
// ellipse(x2, y, 5, 5);
fill(random(255), random(255), random(255));
ellipse(x1+100,y1+width/2, 8, 8);
ellipse(x2+width/2, y2+100, 8, 8);
time1 += timeup1;
time2 += timeup2;
//gridx+=distance;
//gridx = distance;
//gridy+=distance;
}
以上是关于text 旋转圈在progress.pde的主要内容,如果未能解决你的问题,请参考以下文章