In my Geometry class, I added a Matrix normals and a method compute_normals to store and compute the normals at each vertex, respectively. I added a few helper methods in my Matrix class, namely add, subtract, and cross_product. Shading is all done within the HW7_szymczak.java file -- explained within the comments.
I explicitly typed the normals for spheres, rectangular prisms, and 2D shapes. In the applet, the difference in color (eg. between the sphere and klein bottle) is due to the polarity of the face directions and is dependent on how the parameterizations are defined; Notice how the inside of the klein bottle is shaded similarly to the sphere. This is easily rectified by multiplying the normals by -1 for the incongruously colored shapes. I left the applet uncorrected for visual effect.
I explicitly typed the normals for spheres, rectangular prisms, and 2D shapes. In the applet, the difference in color (eg. between the sphere and klein bottle) is due to the polarity of the face directions and is dependent on how the parameterizations are defined; Notice how the inside of the klein bottle is shaded similarly to the sphere. This is easily rectified by multiplying the normals by -1 for the incongruously colored shapes. I left the applet uncorrected for visual effect.
The object of the game is to use the paddle to block the balls from passing below the bottom edge of the screen. The game is initially paused.
- [ spacebar ] : pause/unpause the game
- [ left/right ] : move the paddle
- [ / ] : increase size of balls
- [ . ] : decrease size of balls
| Applet |
PROBLEM FIXED** XR (as defined in the class notes) gets truncated when you cast it as an int. So you have to shade pixels from XL to XR+1.
___________________________________________________________________________________
Package
HW7_szymczak.java
Geometry.java
No comments:
Post a Comment