Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F75604262
sketch_190305a.pde
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Aug 3, 05:23
Size
802 B
Mime Type
text/x-c
Expires
Mon, Aug 5, 05:23 (2 d)
Engine
blob
Format
Raw Data
Handle
19572950
Attached To
rBAFOURPROJECT InfoVisuGit
sketch_190305a.pde
View Options
float depth = 2000;
void settings() {
size(500, 500, P3D);
}
void setup() {
noStroke();
}
void draw() {
camera(width/2, height/2, depth, 250, 250, 0, 0, 1, 0);
directionalLight(50, 100, 125, 0, -1, 0);
ambientLight(102, 102, 102);
background(200);
translate(width/2, height/2, 0);
float ry = map(mouseY, 0, height, 0, PI);
float rz = map(mouseX, 0, width, 0, PI);
rotateZ(rz);
rotateY(ry);
for (int x = -2; x <= 2; x++) {
for (int y = -2; y <= 2; y++) {
for (int z = -2; z <= 2; z++) {
pushMatrix();
translate(100 * x, 100 * y, -100 * z);
box(50);
popMatrix();
}
}
}
}
void keyPressed() {
if (key == CODED) {
if (keyCode == UP) {
depth -= 50;
} else if (keyCode == DOWN) {
depth += 50;
}
}
}
Event Timeline
Log In to Comment