Wednesday, February 24, 2016

float h;
float p;

void setup(){
  size(500,500);
  background(255);

}

void draw(){
 noStroke();
 strokeWeight(0);
 //sunset
 fill(50,50,70);
 rect(0,0,65,500);
 fill(120,90,130);
 rect(62.5,0,65,500);
 fill(190,100,140);
 rect(125,0,65,500);
 fill(255,90,120);
 rect(187.5,0,65,500);
 //sunset
 fill(250,227,98);
 rect(250,0,65,500);
 fill(250,220,121);
 rect(312.5,0,65,500);
 fill(242,250,144);
 rect(375,0,65,500);
 fill(89,209,165);
 rect(437.5,0,65,500);

   
   h -= hour() + (float(minute())/60) + ((float(second())/60)/10);
   if(h < -1){
   h = 1;
   
   
   float p = map(h,0,23,0,width-(width/8));
 }

 println(hour() + (float(minute())/60) + ((float(second())/60)/10));

 sunflower(width/2,height/2);

}

void sunflower(int x,int y){
   //x = location
   //y = location


   //pedals
   pushMatrix();
   translate(x,y);
   scale(h,1);
   fill(240,255,36);
   for(int i = 0; i <= 10; i ++){
   rotate(radians(360/10));
   ellipse(0,-50,35,100);
   }
   fill(193,148,62);
   ellipse(0,0,75,75);
   popMatrix();
   
}


BACKGROUND UPDATE // TIME

I've updated the sky, and the code is different from what I posted yesterday. I've now incorporated 'hours' and it works in my sketch, which in itself seems like a miracle to me. Because the flower will only move from one side to the next over a whole day, you can't tell if it's actually working by just staring at it. You can't tell any immediate change. I added println() and there is in fact change.

Below is the new code for the sky.

Tuesday, February 23, 2016

BACKGROUND

Here is some code I was working on today for the background of my clock. Having the "sky" change color is obviously more realistic than it being white 24 hours/day.

Saturday, February 20, 2016

FOCAL POINT

I've created the flower that spins and I am struggling but still trying to set up code that will spin it according to the time of day. I've also tried connecting the stem to it, but that ended up a little funky too; I think I placed that code in the wrong area.


float f;

void setup(){
  size(500,500);
  background(255);
}

void draw(){
 background(255);

   f -= .01;
   if(f < -1){
   f = 1;
 }
  
 sunflower(width/2,height/2);
}

void sunflower(int x,int y){
   //x = location
   //y = location

   //pedals
   pushMatrix();
   translate(x,y);
   scale(f,1);
   fill(240,255,36);
   for(int i = 0; i <= 10; i ++){
   rotate(radians(360/10));
   ellipse(0,-50,35,100);
   }
   fill(0);
   ellipse(0,0,75,75);
   popMatrix();

}

Wednesday, February 17, 2016

SUNFLOWER

A start to my sunflower, clock sketch -- with much help. I'm still trying to figure out how to draw the flower, and below are some images on curves, which I am also trying to understand. The problem really is not how it is done, but how I am actually going to draw the flower. There are a lot of parts and figuring out coordinates may not be that easy...same with attaching the flower to the moving stem. 












CLOCK1

I've started a simple clock idea. There will be 12 bars that load vertically to represent hours. Each bar is cut into thirds for 20 minute markers and the bars will fill according to the time. Obviously, time will not be represented so specifically. 

I want to continue working on this one as well as my other idea with the sunflower. 







Monday, February 15, 2016

CLOCK pt1

I've been doing some sketching and thinking about how I want my clock to look like. I've come up with what I think is a pretty basic idea. I want to get started on it right away and I've attached below a picture of my thoughts. Time will be indicated by a bar.


A couple other ideas I was thinking of was creating a sketch of something natural that helps tell time. The most obvious would be the sun and moon, however, my sketch wouldn't be able to show the exact time; the viewer would just get a general idea. 


The other, which I think is really cool is creating a sketch of a sunflower. I want to pursue this idea as well as my first one. Sunflowers track the sun and even at night, by the time the sun comes up again, they are facing East. I think it would be really cool to have the sunflower's movement be the representation of what time it is. Again, it wouldn't be able to show the exact time, but the idea is a bit more creative.