【发布时间】:2020-04-30 21:54:36
【问题描述】:
我是一个新的处理编码员,因此请温柔。 通常我的代码更长更复杂,但我为你写了一个简单的代码,我可以在我的代码上进行调整:
int speed = 1;
int x, z = 50;
void setup() {
size(400, 400, P3D);
}
void draw() {
background(0);
noStroke();
lights();
translate(x, height/2, z);
fill(255,0,0);
sphere(25);
if (x > width -50)
noLoop();
x += speed;
}
因此,如您所见,球体以红色开始,并到达窗口的末端。我想将它的颜色从红色变为白色,这需要 30 秒。到达窗口的尽头。但是我不知道怎么做。如果你帮助我,我会很高兴。 注意:我尝试了 lerpColor 功能,但没有帮助。
【问题讨论】:
标签: java 3d processing