Wednesday, 5 December 2012

Some shapes...

We are now learning how to draw shapes using a different programming language (Mr Patel thinks it's something like JavaScript).

Original Code:
// a rectangle
rect(60, 80, 20, 5);
//rect(x-axis, y-axis, width, height);
// a circle/ellipse
ellipse(10, 10, 5, 5);
//ellipse(x-axis-from-centre, y-axis-from-centre, width, height);
// a line
line(100, 100, 206, 200);
//line(x-axis-of-first-point, y-axis-of-first-point, x-axis-of-second-point, y-axis-of-second-point);

What it looks like:
  • x-axis = distance from far left side (of screen, display, etc.)
  • y-axis = distance from top (of screen, display, etc.)
 

5 comments:

  1. I believe it is actually a language called 'processing'.

    ReplyDelete
  2. whoops, my bad. 'processing.js'

    ReplyDelete
    Replies
    1. I thought it was a JavaScript library or something...

      Delete
    2. Ah...
      "Processing.js doesn't convert Processing code into JavaScript. It is a Javascript library that mirrors/wraps Processing methods"
      Source: http://stackoverflow.com/questions/8964257/writing-in-processing-vs-javascript-in-processing-js

      Delete
  3. This comment has been removed by the author.

    ReplyDelete