Add Initial commit
This commit is contained in:
36
CM2030 Graphics Programming/Topic 1/1.3.1d/sketch.js
Normal file
36
CM2030 Graphics Programming/Topic 1/1.3.1d/sketch.js
Normal file
@ -0,0 +1,36 @@
|
||||
function setup() {
|
||||
createCanvas(720, 400);
|
||||
rectMode(CENTER);
|
||||
}
|
||||
|
||||
function draw()
|
||||
{
|
||||
background(220);
|
||||
fill(0);
|
||||
|
||||
translate(200, 200);
|
||||
rotate(radians(45));
|
||||
rect(0, 0, 200, 200);
|
||||
|
||||
fill('red');
|
||||
|
||||
push()
|
||||
translate(100, 100);
|
||||
ellipse(0, 0, 30, 30);
|
||||
pop();
|
||||
|
||||
push();
|
||||
translate(-100, -100);
|
||||
ellipse(0, 0, 30, 30);
|
||||
pop();
|
||||
|
||||
push();
|
||||
translate(100, -100);
|
||||
ellipse(0, 0, 30, 30);
|
||||
pop();
|
||||
|
||||
push();
|
||||
translate(-100, 100);
|
||||
ellipse(0, 0, 30, 30);
|
||||
pop();
|
||||
}
|
||||
Reference in New Issue
Block a user