Design practise in context 2, Code.

Starting my 2nd year of studies I have been introduced to coding using the application “Processing”. Even though you may not realise, coding plays a huge part in the design industry. Everything is made up of codes! In this workshop we explored how to create a drawing using codes adding motion, colour and size.

This is the code we inserted into “Processing”…

float xpos; float ypos; float yinc; float xinc; float xpos2; float ypos2;

void setup(){

println(“hello”);

size(1024, 768);

background(255,255,255);

stroke(100,100,100,30); fill(100,100,100);

xpos=random(1024);

ypos=random(768);

yinc=5; xinc=3;

xpos2=random(1024);

ypos2=random(768);

smooth();

}

}

void draw(){ println(“i am drawing”);

line(xpos,ypos,xpos2,ypos2);

xpos=xpos+xinc; ypos=ypos+yinc;

if(ypos>768) yinc=-5; if(ypos<0) yinc=-5;

if(xpos>1024) xinc=-3; if(xpos<0) xinc=3;

}

At first I was mortified at the thought of understanding the concept of coding but as I worked more and more with the programme it become easier. This code created this animation…

Screen Shot 2013-10-03 at 18.42.42

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s