The mechanisms class was charged with creating egg-cracking Rube Goldberg machines for the first week’s assignment. Rather than breaking the egg shell through brute force, we tossed around the idea of dissolving the egg shell entirely.
Luckily there was some muriatic acid lying around the shop, so we ran a quick experiment. The shell dissolves, but it takes about 20 minutes, and what’s left isn’t a broken egg, but a layer of internal membrane which keeps the de-shelled egg intact. Interesting, but not well suited to the purposes of our machine-to-be, so we shelved the idea.
A quick assignment for GLART, drawing an animated field of triangles.
Here’s the code:
package mika;import java.awt.event.MouseEvent;import javax.media.opengl.*;import jocode.*;/** * DemoBasicGeometry.java * * Demonstrate six types of geometry using glBegin()...glEnd() * * napier at potatoland dot org */public class Week1 extends JOApp { // Set the mouse position in a way that's // useful for translating objects at 0 Z public float screenCursorX; public float screenCursorY; public float tempValue; public float sizeMult; /** * Start the application, Run() initializes the OpenGL context, calls setup(), * handles mouse and keyboard input, and calls draw() in a loop. */ public static void main(String args[]) { // create the app Week1 demo = new Week1(); // set title, window size windowTitle = "Hello World"; displayWidth = 1440; displayHeight = 900; // start running: will call init(), setup(), draw(), mouse functions demo.run(); } /** * Initialize settings. Will be called once when app starts. Called by * JOApp.init(). */ @Override public void setup() { // set a background color gl.glClearColor(0 f, 0 f, 0 f, 1 f); // Move over to my second monitor for testing... // TODO Disable this IRL frame.setLocation(-1440, 150); } /** * Render one frame. Called by the JOApp.display() callback function. */ @Override public void draw() { // Clear screen and depth buffer gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); // Select The Modelview Matrix (controls model orientation) gl.glMatrixMode(GL.GL_MODELVIEW); gl.glEnable(GL.GL_BLEND); gl.glBlendFunc(GL.GL_SRC0_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); // gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE); // Reset the Modelview matrix // this resets the coordinate system to center of screen gl.glLoadIdentity(); // Where is the 'eye' glu.gluLookAt(0 f, 0 f, 10 f, // eye position 6 f, 1 f, 0 f, // target to look at 0 f, 1 f, 0 f); // which way is up // color will affect all the following verts gl.glColor4f(1 f, 1 f, 1 f, 0.5 f); // gl.glColor3f(1f, 1f, 1f); sizeMult = 3; tempValue = (tempValue + .02 f) % 1000; for (int i = 0; i < 200; i++) { gl.glRotatef(tempValue, tempValue, tempValue, tempValue); gl.glTranslatef(.1 f, .1 f, .1 f); gl.glBegin(GL.GL_TRIANGLES); { // top gl.glVertex3f(0 f, 0 f, 0 f); // lower left gl.glVertex3f(-0.5 f * sizeMult, -1 f * sizeMult, 0 f); // lower right gl.glVertex3f(0.5 f * sizeMult, -1 f * sizeMult, 0 f); } gl.glEnd(); } // reset vertex color to white gl.glColor3f(1 f, 1 f, 1 f); } @Override public void mouseMoved(MouseEvent _event) { // Call the parent method since it actually gives us the // Better just to copy the whole method? super.mouseMoved(_event); screenCursorX = cursorX / (displayWidth / 10 f); screenCursorY = cursorY / (displayHeight / 10 f) - 3 f; }}
I spent an unreasonable portion of my childhood in the back seat of a car, staring out the window. Rainy days, in particular, allowed for one of the more confounding means of passing the time: attempting to predict and understand the movements of water drops on the window.
The 4 Big Myths of Profile Pictures: a straight-faced analysis of how profile pictures of various types correlate with “success” on a dating website. The text’s self-help tone is a bit cheeky, but the conclusions are based on several thousand profiles worth of data, and the charts and graphs are pure gold:
The output from my real-time sky cam remains inconsistent. The color of the sky was supposed to set the background color of this blog… but I’m having second thoughts.
I was expecting shades of blue, but ended up with yellows and browns… assaults on the eyes that are too much to bear. Until I can muster a better color-sensing solution, I’m returning the blog background to its original light-gray. In the mean time, the sky camera will continue to send its uninspired color values up to Pachube every minute.
And so, failure: The whole idea was to lighten up and relinquish some aesthetic control to an unknowing third party. It was more than I could handle. For shame.