Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61222698
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
Sun, May 5, 07:44
Size
802 B
Mime Type
text/x-c
Expires
Tue, May 7, 07:44 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17482312
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