As computing becomes more ubiquitous in our objects, designers need to be more aware of how to design meaningful interactions into electronically enhanced objects. At the University of Washington, a class of junior Interaction Design majors is exploring this question. These pages chronicle their efforts.

Friday, June 12, 2020

Processing Experimentation : Mixture Grid



1.
/**
* Mixture Grid
* modified from an example by Simon Greenwold.
*
* Display a 2D grid of boxes with three different kinds of lights.
*/
void setup() {
size(1440, 900, P3D);
noStroke();
}
void draw() {
defineLights();
background(0);

for (int x = 0; x <= width; x += 60) {
for (int y = 0; y <= height; y += 60) {
pushMatrix();
translate(x, y);
rotateY(map(mouseX, 0, width, 0, PI));
rotateX(map(mouseY, 0, height, 0, PI));
box(120,15,45);
sphere(12);
popMatrix();
}
}
}
void defineLights() {
// Green point light on the right
pointLight(51, 255, 0, // Color
300, -100, 0); // Position
// Purple directional light
directionalLight(130, 67, 255, // Color
1, 0, 0); // The x-, y-, z-axis direction
// Blue spotlight from the front
spotLight(58, 216, 255, // Color
0, 40, 200, // Position
1, 3, -0.5, // Direction
PI / 2, 2); // Angle, concentration
}
2. Lights on Rotating Shapes and Changing Colors
3.  I changed variables that are parts of the initial code already.  First of all, I changed the size of the artboard and the boxes that are respondent to the cursor. Also, I added another sphere shape to each grid. After that, I modified the colors of shapes and shades to make it cooler! 

No comments:

Post a Comment