import processing.xml.*; import processing.candy.*; void setup(){ size(1024,1024); background(255,225,200); frameRate(11); noFill(); SVG m; //void setup(){ // size(400,400); // The file "stem.svg" must be in the data folder // of the current sketch to load successfully m = new SVG(this, "stem2.svg"); m.drawMode(CENTER); m.draw(width/2, height/1.3); } //-------------------------------------------------------------- void draw(){ stroke(0,0,0); fill(124,19,13); //------(e)-------------------------------------- // // use sin cos and time to make some spirally shape // pushMatrix(); translate(512,350); int rCola = 244; int gCola = 20; int bCola = 23; color(rCola,gCola,bCola); beginShape(QUAD_STRIP); float angleStepA = (16*TWO_PI)/(90.0f + sin(millis()/4.0f) * 55); float radiusAdderA = 1.5f; float radiusA = 0; for (int i = 0; i < 200; i++){ rotate(PI/3.0); float anglefA = (i) * angleStepA; float x = radiusA * cos(anglefA); float y = radiusA * sin(anglefA); vertex(x,y); radiusA += radiusAdderA; } endShape(); popMatrix(); }