A simple fade in for a SVG
in
Programming Questions
•
1 year ago
Is there a simple code to apply to a svg to fade?
thanks!
Code below if it helps!
PShape logo;
float angle;
float jitter;
void setup() {
size(800,250);
logo = loadShape("logo.svg");
smooth();
frameRate(50);
shapeMode(CENTER);
}
void draw() {
background(255,255,255);
// during even-numbered seconds (0, 2, 4, 6...)
if (millis() >= 7000){
jitter = 2.5;
}
angle = angle + jitter;
pushMatrix();
float c = cos(angle);
translate(width/6, height/2);
rotate(angle*TWO_PI/360);
shape(logo, 0, 0, 200, 200);
popMatrix();
}
1