Monday, November 17, 2014

Chapter Four

So I was trying to get the wave clock to work, however mine would only ripple over each other instead of turning. So I tried to add an extra for-loop and rotational translation, to make it spin, and I ended up with this funky sun/hurricane shape :)



Code:
float anglenoise, radiusnoise;
float xnoise, ynoise;
float angle = -PI/2;
float radius;
float strokeCol = 254;
float strokeChange = -1;
void setup()
{
 size(500,500);
smooth();
frameRate(30);
background(255);
noFill();

anglenoise = random(10);
radiusnoise = random(5);
xnoise = random(10);
ynoise = random(10);

}

void draw()
{
  float count =0;
 radiusnoise += 0.005;
radius = (noise(anglenoise)*200)-3;
if(angle>360)
{angle -=360;}
if(angle<0 angle="" p="">

for( float ang=0; ang<= 360; ang+=5){
xnoise += 0.01;
ynoise +=0.01;
//float centerX = width/2 + (noise(xnoise)*100)-50;
//float centerY = height/2 + (noise(ynoise)*100)-50;
float centerX = 0 + (noise(xnoise)*100)-50;
float centerY = 0 + (noise(ynoise)*100)-50;

float rad = radians(angle);
float x1 = centerX+ (radius * cos(rad));
float y1 = centerY+(radius *sin(rad));

float opprad = rad + PI;
float x2 = centerX+ (radius * cos(opprad));
float y2 = centerY+(radius *sin(opprad));

strokeCol+= strokeChange;
if(strokeCol>254){strokeChange= -1;}
if(strokeCol<0 strokechange="1;}</p">
stroke(strokeCol, 60);
strokeWeight(1);

pushMatrix();
    translate(width/2, height/2);
    rotate(radians(60+count));
    line(x1,y1,x2,y2);
    popMatrix();
count+=10;
}
}


Monday, November 3, 2014

Wrong Way To Draw A Circle (Chapter 4)


Spiral with randomness and noise

Wrong Way To Draw A Line (Chapter 3)


Data, XML, and 2D Transformations

Data:

I reviewed the importing, exporting, writing and reading from files, which was similar to what we did in AP. Like Julia, I was very confused when I got to the XML part of it.

2D Transformations

I made a waddling penguin (code in comments for motion)








Sunday, November 2, 2014

Chapter 3

"Wrong Way to Draw Lines"

Breaking a line into different fragments and adding a random noise element to the line.

Data and XML Format

Data:
So I practiced importing data from .txt files, like we've done previously in AP comp sci, but I was very confused about the whole XML format and when/why we would use it. I know this is last minute before the quarter ends, but next time we meet do you think we could go over a few things?

2-D Translations

2-D translations:

My feeble attempt to make a dog with a wagging tail:
How could I make the tip of the tail move back and forth without the whole thing moving?
(I'll put my code in the comments)

Also could maybe go over some of the input methods like atan2() that uses the mouse's position?

Friday, October 31, 2014

Some computer generated art to consider

I thought I'd start putting up some links to computer generated art.  To try and give you some ideas for what to work towards in the second quarter.  This will be the first of several posts like this.

http://reas.com/

http://www.moma.org/visit/calendar/exhibitions/305

https://www.youtube.com/watch?v=_8DMEHxOLQE

http://jonmccormack.info/~jonmc/sa/news/art-pattern-and-complexity/

Sunday, October 26, 2014

Fonts

Knock Knock Jokes!


Playing with font effects:


Images and Pixels

Using the LoadImage() and Tint() methods to change color and transparency:


Mapping pixels from a pre-loaded picture



Making our own tint
(brightness follows mouse with a radius of 60 pixels)


Friday, September 26, 2014

Wednesday, September 24, 2014

Two-Dimensional Arrays


Fun flashing dots oscillating color with Sine. 

Color

I mentioned this when we met, but make sure you really do understand how the RGB and HSB color models work.

HSB is the mode that you may be less familiar with, and just to make things confusing there are 2 similar color models HSL and HSV.

In Processing, go to the Tools menu and open the Color Selector.  You will see that the colors are given as both HSB and RGB values.  The selector itself uses the HSB model.  The vertical "rainbow" bar changes the Hue value only.  In the large square, moving in the x-axis changes the Saturation value, and moving in the y-axis changes the Brightness value.

This Wikipedia entry on HSL and HSV is a bit more technical than you really need.  But, the Basic Principle and Motivation sections are useful to read.

Here is a simple little program that plays with color.  mouseY controls the color, mouseX controls the size of the central rectangle.

void setup()
{
   size(720,720);
   // noCursor();
}

void draw()
{
   colorMode(HSB, 360, 100, 100);
   rectMode(CENTER);
   noStroke();
   background(mouseY/2, 100, 100);
  
   fill(abs(180-mouseY/2), 100, 100);
   rect(360, 360, mouseX+1, mouseX+1);
 
}

Beginner Level Tutorials

Overview, Coordinate Systems and Shapes:
I made a mouse.

Color:
For this tutorial, I used multiple colors and transparencies.



Objects:
Similar to Julia, I did not take a picture due to the movement of objects, but it served as good review for both objects and classes

Sunday, September 14, 2014

Beginner Level Tutorials (Overview- Objects)

Overview Tutorial:
Not much code to show... I just reread the basics, practiced exporting, and learned more about the setup() and draw() functions.

Coordinate System and Shapes:
I made a little white stick figure:

Color:
I played around with the colorMode() and transparency.


Objects:
I ran through the examples and I figured taking a picture of the example wouldn't quite work with the moving objects. However, this tutorial was a great review of objects and classes.