(add grid code) |
No edit summary |
||
Line 3: | Line 3: | ||
=== homework 1 === | === homework 1 === | ||
= | <source lang = "java"> | ||
void setup() | |||
{ | |||
size(400,400);<br> | |||
background(0,0,0);<br> | |||
frameRate(9);<br> | |||
println(frameCount);<br> | |||
println(frameRate);<br> | |||
} | |||
void draw() | |||
{ | |||
PImage image1 = loadImage("park_001.jpg");<br> | |||
PImage image2 = loadImage("park_002.jpg");<br> | |||
PImage image3 = loadImage("park_003.jpg");<br> | |||
PImage image4 = loadImage("park_004.jpg");<br> | |||
PImage image5 = loadImage("park_005.jpg");<br> | |||
PImage image6 = loadImage("park_006.jpg");<br> | |||
PImage image7 = loadImage("park_sieben.jpg");<br> | |||
PImage image8 = loadImage("park_acht.jpg");<br> | |||
PImage image9 = loadImage("park_009.jpg");<br> | |||
if (frameCount % 9 == 1) { | |||
image(image1,0,0,400,400); | |||
} | |||
if (frameCount % 9 == 2) { | |||
image(image2,0,0,400,400); | |||
} | |||
if (frameCount % 9 == 3) { | |||
image(image3,0,0,400,400); | |||
} | |||
if (frameCount % 9 == 4) { | |||
image(image4,0,0,400,400); | |||
} | |||
if (frameCount % 9 == 5) { | |||
image(image5,0,0,400,400); | |||
} | |||
if (frameCount % 9 == 6) { | |||
image(image6,0,0,400,400); | |||
} | |||
if (frameCount % 9 == 7) { | |||
image(image7,0,0,400,400); | |||
} | |||
if (frameCount % 9 == 8) { | |||
image(image8,0,0,400,400); | |||
} | |||
if (frameCount % 9 == 0) { | |||
image(image9,0,0,400,400); | |||
} | |||
println(frameCount % 9); | |||
println(frameCount); | |||
println(frameRate); | |||
} | |||
</source> | |||
==== grid of nine photos - addition to homework 1 ==== | |||
= | <source lang = "java"> | ||
image(image1,0,0,100,100); | |||
image(image2,100,0,100,100); | |||
image(image3,200,0,100,100); | |||
image(image4,0,100,100,100); | |||
image(image5,100,100,100,100); | |||
image(image6,200,100,100,100); | |||
image(image7,0,200,100,100); | |||
image(image8,100,200,100,100); | |||
image(image9,200,200,100,100); | |||
</source> | |||
=== homework 2 === | === homework 2 === | ||
=== homework 3 === | === homework 3 === |
Revision as of 14:01, 17 December 2015
Pascal Delor
homework 1
void setup()
{
size(400,400);<br>
background(0,0,0);<br>
frameRate(9);<br>
println(frameCount);<br>
println(frameRate);<br>
}
void draw()
{
PImage image1 = loadImage("park_001.jpg");<br>
PImage image2 = loadImage("park_002.jpg");<br>
PImage image3 = loadImage("park_003.jpg");<br>
PImage image4 = loadImage("park_004.jpg");<br>
PImage image5 = loadImage("park_005.jpg");<br>
PImage image6 = loadImage("park_006.jpg");<br>
PImage image7 = loadImage("park_sieben.jpg");<br>
PImage image8 = loadImage("park_acht.jpg");<br>
PImage image9 = loadImage("park_009.jpg");<br>
if (frameCount % 9 == 1) {
image(image1,0,0,400,400);
}
if (frameCount % 9 == 2) {
image(image2,0,0,400,400);
}
if (frameCount % 9 == 3) {
image(image3,0,0,400,400);
}
if (frameCount % 9 == 4) {
image(image4,0,0,400,400);
}
if (frameCount % 9 == 5) {
image(image5,0,0,400,400);
}
if (frameCount % 9 == 6) {
image(image6,0,0,400,400);
}
if (frameCount % 9 == 7) {
image(image7,0,0,400,400);
}
if (frameCount % 9 == 8) {
image(image8,0,0,400,400);
}
if (frameCount % 9 == 0) {
image(image9,0,0,400,400);
}
println(frameCount % 9);
println(frameCount);
println(frameRate);
}
grid of nine photos - addition to homework 1
image(image1,0,0,100,100);
image(image2,100,0,100,100);
image(image3,200,0,100,100);
image(image4,0,100,100,100);
image(image5,100,100,100,100);
image(image6,200,100,100,100);
image(image7,0,200,100,100);
image(image8,100,200,100,100);
image(image9,200,200,100,100);