Saturday, March 9, 2013

HW6 - Frame Buffers

I altered MISapplet to reinitialize values if the animation window changes size. In my java programs I store my own pixel values at a set resolution so I can stretch the animation window without breaking the code or increasing computation. I also store my own array because short of overriding computeImage, you can not nicely alter the pix[] array. To aid my computations I added the method set(int,int,int,int,int,int,int,int,Matrix) in Matrix.java to copy the contents from a part of one matrix into a part of another.


Fun With MISapplet 

  • spacebar ] : change exponent (toggle between bulb and brot)

MISapplet - Mandelbulb

This is my first MISapplet that animates the Mandelbulb and Mandelbrot set. It takes about 2 minutes to generate 600x600 resolution so instead I read the image from a file (URL) of precomputed values. Reading from the URL shouldn't take more than a couple seconds. If you are compiling and running directly from your computer, you may need to change java permissions to read from a URL. The zip download below includes a file called applet.policy that does this. When executing the appletviewer command, add the flag

-J-Djava.security.policy=applet.policy

The code lets you either read the image from a URL, read the image from a local txt file, or generate the image. The latter two are commented out. The txt files are available for download separately.



Backward Triangles

  • arrow keys ] : x,y rotation speed
  • wasd ]  : x,y in-place rotation speed
  • [ / ] : stop rotation
  • spacebar ] : reset screen

MISapplet - Triangulation

If a triangle is facing forwards I fill it in. If one is facing backwards I only draw the edges.


___________________________________________________________________________________

No comments:

Post a Comment