Showing posts with label Processing. Show all posts
Showing posts with label Processing. Show all posts

Thursday, September 13, 2012

processing experiment 1

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection
There's so much you can do with simple values. In this processing sketch, I'm only using a line and ellipse function to draw various shapes and abstract compositions on the canvas. Funny what random values can do.





Tuesday, April 3, 2012

processing sketch : transparent circles

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection




I made this using processing. Ok, this isn't really processing per se, but it is processing.js. Both use the same coding just that processing.js is a lighter and more efficient way to display your processing sketches on a web page. In this simple sketch circles of varying opacity are drawn on the screen and the position of the circles are determined by the position of your mouse. The colour and the opacity are random. To clear the screen and to start again, press the key 'C'.

The code is given below. I have explained some lines of code so you understand what I have created.

void setup() //method to initialize the sketch. Only runs 1 time.
{
  size(600, 600); //determines size of sketch
  background(255); //background colour
  smooth(); //smoothens everything out
}
void draw() //method to draw on sketch. Runs every time till program is stopped.
{
  noStroke(); //circles don't have an outline
  float x = random(20, 60); // random size with limits from 20 to 60
  ellipse(mouseX, mouseY, x, x); // circles with position determined by mouse
  fill(random(200), random(200), random(255), random(100)); // random colour and opacity
  if (keyPressed) //detects if a key is pressed
  {
    if (key=='c'||key=='C') //now looks for key 'c'
    {
      background(255); //clears screen
    }
  }
}


Monday, April 2, 2012

Processing

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection
Have you ever fantasized about being a computer programmer and create stuff simply by typing a few commands? Yet, like me, you hate the complexity and the learning curve of the Java, C++ and the rest? Fear not, for processing is here!



Processing is Java based compiler which requires basic Java coding know-how to create insanely cool graphics within minutes of downloading the compiler. It's extremely simple to learn processing, and with a few months of solid practice you can create anything you want with a few lines of code. Sounds too good to be true right? However, apart from a few minor problems with some geeky stuff which won't bother you anyway, it is fantastic. You can do 3D modeling on it as well!

So download processing and code away!


Here are a few examples,




Tree using recursion


 
//PART 2