Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
uhcakip
uhcakip's Profile
2
Posts
3
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Clock in the form of a "loading bar"
[6 Replies]
17-Jan-2013 09:08 AM
Forum:
General Discussion
Hey guys.
I'm making a clock in the form of a "loading bar" using Processing.
- It's my goal to have the bar LOAD from 12 o clock in the night until 12 o clock in the midday.
- And to have it LOAD BACK (unload) from 12 o clock in the midday until 12 o clock in the night.
..........
Right now I'm having a lot of trouble to make the bar LOAD BACK after it hits 12 o clock in the midday.
Does anyone know the proper code to make it work?
This is my code:
float Time = 0;
float Check = 600;
int Sized = 20;
int Count = 0;
void setup(){
colorMode(RGB, 720);
size ( 800,400);
background(0);
noStroke();
smooth();
}
void draw() {
float s = second();
float m = minute()*60;
float h = hour()*3600;
Time = (m+s+h)*0.01388889;
println (Time);
println (m+s+h);
if( h >= 12) {
fill(720);
rect( 100, 200, 50, Sized);
fill(200);
rect( 150, 200, 50, Sized);
fill(255);
rect( 200, 200, 50, Sized);
fill(200);
rect( 250, 200, 50, Sized);
fill(255);
rect( 300, 200, 50, Sized);
fill(200);
rect( 350, 200, 50, Sized);
fill(255);
rect( 400, 200, 50, Sized);
fill(200);
rect( 450, 200, 50, Sized);
fill(255);
rect( 500, 200, 50, Sized);
fill(200);
rect( 550, 200, 50, Sized);
fill(255);
rect( 600, 200, 50, Sized);
fill(200);
rect( 650, 200, 50, Sized);
fill(720-(hour()*12),hour()*12,0);
rect( 100, 200, Time, Sized);
}
else {
fill(720);
rect( 100, 200, 50, Sized);
fill(360);
rect( 150, 200, 50, Sized);
fill(255);
rect( 200, 200, 50, Sized);
fill(100);
rect( 250, 200, 50, Sized);
fill(255);
rect( 300, 200, 50, Sized);
fill(100);
rect( 350, 200, 50, Sized);
fill(255);
rect( 400, 200, 50, Sized);
fill(100);
rect( 450, 200, 50, Sized);
fill(255);
rect( 500, 200, 50, Sized);
fill(100);
rect( 550, 200, 50, Sized);
fill(255);
rect( 600, 200, 50, Sized);
fill(100);
rect( 650, 200, 50, Sized);
fill(0,0,0);
rect( 100, 200, Check - Time, Sized);
}
}
Thanks in advance!
typographic question :)
[2 Replies]
23-Nov-2012 12:50 AM
Forum:
General Discussion
Hey guys, for an important school asignment I have to animate the letter Q in Processing.
I thought it was cool to make a Q out of moving particles but I really don't know how to do this.
This one, for example, is pretty awesome:
http://www.openprocessing.org/sketch/11123
Does anyone know how to manipulate the code to make a Q built out of particles from it?
I will be very grateful and maaaaybe even turn out a reward to the one that can help me with this.
«Prev
Next »
Moderate user : uhcakip
Forum