Sunday, February 15, 2009

Interesting Picture exercise

For the second part of the assignment, I had to make an interesting looking picture using various built-in transformation methods, as well as pushMatrix and popMatrix.
Below is a screenshot of the picture my project makes.



The source code is located here

Saturday, February 14, 2009

Transformation Matrices

For this assignment, we were to create our own functions to perform rotation and translation on values stored in a matrix. My program waits for a user to input 3 points on the screen by clicking on any location. Once the three points have been input, the user may hit Enter/Return to make the program show the steps it takes in rotating the triangle.


Basically, the initial triangle (the TAN colored one) is translated to the origin (that is drawn as the RED triangle). It is then rotated correctly (that is the GREEN triangle) and then translated back to the location of the original triangle (which is the BLUE triangle

But... That is not the only thing this program does. Should the user click the screen more than the initial three times, the program will do some pretty interesting stuff. You can try it out yourself here.
Please note that if you press the DELETE button, you can reset the screen and create a new masterpiece.

The source code is located here.

Saturday, February 7, 2009

Project Proposal

As far as projects go, trying to recreate and enhance this particle sphere would be interesting to undertake.

Particle Sphere

There is a ton of opportunity to enhance what is seen here. For one thing, it would be possible to have the particles repelled from or drawn to the mouse, and they could travel at different speeds because of their acceleration to/from the mouse. The particles themselves could probably change dynamically to give the impression of movement other than around the sphere.

Thursday, February 5, 2009

Line Clipping Exercise

This program was an exercise in calculating, and clipping lines if they did not fall within a boundary box. The basic instructions for this program was to have the program randomly draw up to 5 triangles on the screen, and if they were not located inside of the box, they would be "clipped."
I decided that instead of merely just not drawing the portions outside of the boundary box, I would instead draw them in a monochrome color. This both shows how the original triangle was laid out, and what sections of the triangle are located outside of the box.

Click this link to use the program. Click on the screen to make it draw one triangle at a time.

The source code is located here.

Multi-Triangles Project

For this exercise, I was instructed to create an interactive program that allows a user to draw a single triangle by clicking on three points anywhere on the screen. After that, the program is supposed to draw up to 5 more triangles randomly across the screen. I intentionally set it that the new, randomly generated triangles appear one at a time per every mouse-click after the initial triangle is created.

Since the posting of my last entry, I have researched how to link to an executable .jar file, and will see about going back and adding links to the programs from previously.
Click this link to see this program in action.

The source code is located here.