fundamentals of programming
Download
Skip this Video
Download Presentation
Fundamentals of Programming

Loading in 2 Seconds...

play fullscreen
1 / 7

Fundamentals of Programming - PowerPoint PPT Presentation


  • 117 Views
  • Uploaded on

Fundamentals of Programming. SM1204 Semester A 2012. Due date 30 Oct Collection via ACS. Assignment 1. Requirements. Create your own drawing brushes (20%) Use of "if-else" or "for" structures (20%) Use of random or noise functions (20%)

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Fundamentals of Programming' - bowen


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
fundamentals of programming

Fundamentalsof Programming

SM1204 Semester A 2012

assignment 1
Due date 30 Oct

Collection via ACS

Assignment 1
requirements
Requirements
  • Create your own drawing brushes (20%)
  • Use of "if-else" or "for" structures (20%)
  • Use of random or noise functions (20%)
    • Apply to positions / colors / sizes of elements you draw
  • With basic user interaction (20%)
    • e.g. mousePressed, mouseX, mouseY
  • Creative graphics (20%)
example
Example
  • http://mrdoob.com/projects/harmony/
example circles
Example - Circles

float d = dist(pmouseX, pmouseY, mouseX, mouseY);

noFill();

stroke(255);

for (inti=0; i<5; i++)

{

float s = (d+4)*(i+1);

ellipse(mouseX, mouseY, s, s);

}

example grids
Example - Grids

fill(0, 10);

noStroke();

rect(0, 0, width, height);

if (mousePressed == true)

{

int r = mouseY / 15;

int c = mouseX / 15;

fill(255);

rect(c*15+1, r*15+1, 14, 14);

}

useful functions references
Useful Functions & References
  • dist(x1, y1, x2, y2)
    • Calculates the distance between two points
  • mouseX, mouseY
    • the current coordinate of the mouse
  • pmouseX, pmouseY
    • The position of the mouse in the previous frame
  • random(low, high)
    • Generate random numbers (floating-point value) between low and high
ad