Showing posts with label #DSDN 142_p3. Show all posts
Showing posts with label #DSDN 142_p3. Show all posts

Thursday, 7 June 2012

final

This is my final application!

Stars
http://www.openprocessing.org/sketch/63533





My code

float [] x= new float[100];
float [] y= new float[100];
float [] a= new float[100];
float [] b= new float[100];
float [] xdot= new float[500];
float [] ydot= new float[500];

float r = random (-250,250);
float r2 = random (-250,250);
float r3 = random (-250,250);

float centerX= 250;
float centerY= 250;


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

    int count = 0;
  while (count<500){
  xdot[count] = random (500);
  ydot[count] = random (500);
  count = count+1;
  }

    int i =0;

  while (i<100) {
  x[i] = 250;
  y[i] = 250;
  a[i] = r2;
  b[i] = r3;
    i=i+1;
  }
  }


void draw() {

  background(0);

    int count = 0;
  while (count<500){
  float R = random (0);
  float G = random (100, 150);
  float B= random (100, 200);
  fill (R, G, B);
  noStroke();
  ellipse (xdot[count], ydot[count], 1, 1);
  count = count+1;
  }

  float R = random (0);
  float G = random (100, 150);
  float B= random (100, 200);
  fill (R, G, B);
  noStroke();
  if (mousePressed == true) {
  float r = 5;

      int i =0;
    while (i<100) {
      x[i]= x[i] + ((mouseX-x[i]) / (5.0 + (i*5.0) ));
      y[i]= y[i] + ((mouseY-y[i]) / (5.0 + (i*5.0) ));

      i=i+1;
    }

    int newcirc = 0;
    int arms=7;
    centerX=centerX+((mouseX-centerX)/50.0);
    centerY=centerY+((mouseY-centerY)/50.0);

    while (newcirc<arms) {
      pushMatrix();
      translate(centerX, centerY);
      rotate((TWO_PI/arms)*newcirc);
      translate(-centerX, -centerY);

        i =0;
      while (i<100) {
        ellipse (x[i], y[i], r, r);
       
        i=i+1;
      }

      popMatrix();

      newcirc=newcirc+1;
      }

    ellipse(centerX, centerY, r, r);
  }


  else {

    float r = 5;
    float t = 5;
    int i =0;
    while (i<100) {
      x[i]= x[i] + ((mouseX-x[i]) / (5.0 + (i*5.0) ));
      y[i]= y[i] + ((mouseY-y[i]) / (5.0 + (i*5.0) ));

      i=i+1;
    }

      int newcirc = 0;
      int arms=7;
    while (newcirc<arms) {
      pushMatrix();
      translate(mouseX, mouseY);
      rotate((TWO_PI/arms)*newcirc);
      translate(-centerX, -centerY);

        i =0;
      while (i<100) {

        fill(R, G, B, t);
        ellipse (x[i], y[i], r, r);
        i=i+1;
      }

      popMatrix();

      newcirc=newcirc+1;
    }
    fill(R, G, B, t);
    ellipse(mouseX, mouseY, r, r);
  }
}

void mousePressed (){
  centerX=mouseX;
  centerY=mouseY;
}



Wednesday, 6 June 2012

Experimentation with the background

Using picture of space

some of the pictures I tried as well






Attempt to get stars on the background moving as well.
I know why this attempt failed. Because all the dots follow the mouse and then they all just stay right under the cursor overlapping each other, so they look as a one dot. But I jst didn't manage to figure out the way how to make them just chase the mouse all the time without going directly to the cursor and staying there.

Friday, 11 May 2012

"The impossible game" Project 3 (Interactive mouse toy) inspiration





The first thing that came into my mind after reading the project 3 outline was "The impossible game". I know this is a game, not an interaction, but I think it's a great example of how really simple thing can be really interesting and fun to play with, which proves that something interesting and amazing doesn't mean something complex. I probably should tell a little bit about the game itself. "The impossible game" is an i-pod application. Basically the rules are you touch the screen at the right moment. When you touch the screen, the little cube jums over the obstacles and if you don't do it at the right moment it explodes and you start the level from the very begining.
Also what I love about this game is that the cube is supposed to jump to the beat, so the music is used to help to get the right moment

And just to show you what happens if you fail. http://www.youtube.com/watch?v=NCuM5M-DfPw