Hi everyone,
I’m new in processing dev, I have this code to scale a svg, I don’t know how to start again the scale when the svg go out the screen, like being at the original size and position .
Thank’s
Yves
PShape bot;
boolean kk= false;
Timer timer_tree;
void setup() {
size(1900, 1000, P3D);
// The file "bot1.svg" must be in the data folder
// of the current sketch to load successfully
bot = loadShape("kk.svg");
frameRate(30);
timer_tree = new Timer(2000);
timer_tree.start();
}
void draw(){
background(0);
if (timer_tree.isFinished()) {
pushMatrix();
bot.disableStyle(); // Ignore the colors in the SVG
fill(255); // Set the SVG fill to white
rotateY(-.5f);
shapeMode(CENTER); // set shape origin to the center of the shape
shape(bot, 280, 40);
bot.scale(1.01, 1.01, 1.01); // Draw at coordinate (280, 40) at the default size
//println(bot.width);
popMatrix();
}
}