Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

SVG data can also be used in processing, but note that some SVG files may not be supported by processing. Processing can only handle simple SVG graphics, so avoid using radial gradients or complex clipping masks. You can however extend the SVG capabilities of processing using the geomerative library http://www.ricardmarxer.com/geomerative/. 

When exporting SVGs from illustrator, the following settings should produce working results. This does, however, depend on your version of illustrator. 

...

Code Block
PImage[] imageList = null;    // create an empty array


void setup()
{
  size(600800,600800);   
  // def. window size
 
  imageList = new PImage[3];
  imageList[0] = loadImage("./images/1.jpg");
  imageList[1] = loadImage("./images/2.jpg");
  imageList[2] = loadImage("./images/3.jpg"); 
}


void draw()
{
  background(255);
  
  pushMatrix();
    translate(10,100);
    for(int i=0;i < imageList.length; i++)
    {
       image(imageList[i],0,0,140,140imageList[i].width/2,imageList[i].height/2); 
       translate(150,0);
    } 
  popMatrix();
}

Download source

Exercise 9

  • Draw a

...

  • spaceship (

...

  • spaceShip.jpg) and let this

...

  • follow the mouse.
  • Make the planets orbit around the a sun in the middle of the screen. 
  • Change the program (and the image file) so that the planet is shown without the

...

  • black box surrounding it. What file types are best suited for this? 

Exercise 9 possible solution