Processing – Week 6

Week 6, during the lesson, we learnt how to create time and clock in processing.

Time

Screen Shot 2015-03-24 at 12.54.57

We learnt how to create Time and Date in processing, I have learnt how to use the code:

text(“Time and Date”, 10, 30);
fill(#FFFFFF);
textSize(45);
text(hour(), 150, 100);
text(minute(),250,100);
text(second(),350,100);
text(day(),200,200);
text(month(),100,200);
text(year(),300,200);

Screen Shot 2015-03-24 at 12.54.46

This is how it look and I have understanding this code to create the time and date.

Clock

Screen Shot 2015-03-24 at 12.58.51

 

Firstly, I looked at it and how to create the clock animation but I couldn’t understand so I did some code.

void setup(){

size(600,600);
strokeWeight(20);

}

void draw () {
background(255,0,0);
stroke(second(),second());
line(second()*10,0,second()*10,600);
line(minute()*10,0,minute()*10,600);
stroke(#0AFFFD);
ellipse(300,300,second()*10,second()*10);
stroke(#0DFA2A);
ellipse(200,200,second()*10,second()*10);

}

Screen Shot 2015-03-24 at 12.58.35

and this is how it looks. I added another ellipse but it looks messy.

Clock (Understanding)

Screen Shot 2015-03-24 at 13.00.59

I have looked at it again and I have done processing again to create another clock to understand this code:

void setup(){
size(600,600);
strokeWeight(15);
}

void draw () {
background(#58FF50);
stroke(second(),second());
line(second()*10,0,second()*10,600);
line(minute()*10,0,minute()*10,600);
stroke(#FC1F1F);
ellipse(300,300,second()*10,second()*10);
}

Screen Shot 2015-03-24 at 13.01.11

 

This is how it looks like now and will continue practising.

Counter

Screen Shot 2015-03-24 at 13.02.20

I have learnt how to create images of numbers using processing and  uploaded images.

Screen Shot 2015-03-24 at 13.02.35

I understand more now how to use processing.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s