• Rob George

Week 9: PDF Library + VCD Interface Digital Sketches

Updated: Dec 10, 2020

Task 1: Simple line drawing

The task was to create a simple line drawing and use the PDF library to save shots from this program.


//Task 1: Simple Drawing


import processing.pdf.*;


void setup(){

size(400,400);

beginRecord(PDF, "draw_2");

}


void draw(){

line(mouseX,mouseY, width/2,height/2);

}


void keyPressed(){

if(key == 'q') {

endRecord();

exit();

}

}


Task 2: Rainbow in the Sky

The task was to use an image of the sky and create a rainbow with randomized vibrant colors. I was also supposed to use the PDF library to save shots of this animation.


//Task 2: Rainbow


import processing.pdf.*;


PImage img;


void setup(){

size(300,300);

beginRecord(PDF, "rainbow_2");

img=loadImage("Sky.jpg");

image(img, 0, 0);

noFill();

smooth();

colorMode(HSB);

frameRate(10);

}


void draw(){

strokeWeight(random(3,10));

stroke(random(255),255,255);

float Sky_size = random(100,300);

ellipse(width/2, height+20, Sky_size, Sky_size);

}


void keyPressed(){

if(key == 'q') {

endRecord();

exit();

}

}


Assignment 1: 25 Dots PDF

The assignment was to use the PDF Library to take shots of all the 25 Dots exercises.




Assignment 2: VCD Interface Digital Sketches

I had to choose one of my concepts from last week for the VCD Interface and create digital sketches of it. I chose to go with the white board because I felt it was more classy and portrayed the program better. Bringing the white board that we use everyday onto the screen, I feel, helps bring the atmosphere of the lab on campus to the computer.


< Back to Coding Main Page

6 views0 comments