Projects

PHP Data Pivot
PHP Data Subtotals
HTML5 Graph
Java NW3D2
JS Code Formatter
HTML5 Clock
Silverlight Gauge
Java NW3D
Java Fireworks
Java Early 3D
Java Snow
Java Dogfight
Java Water Simulation
Java Bump Mapping
Java Elite Ships

Early 3D experiments

Part 1 - Lighting and Shading

On this page you will find Java applets demonstrating various methods of lighting, shading and texturing. There are four applets per model, from left to right: Unshaded, Flat shading, Flat shading with specular highlights, Gouraud shading with specular highlights. All of the applets are based on my home written 3D renderer, which features a z-Buffer, auto scaling, double buffering, back face culling, DirectX geometry file parser and browser scripting interface. All of the test applets display a FPS (frames per second) statistic that helps illustrate the relative processing cost of the different lighting and shading algorithms. The normal production applet, used elsewhere in this site, doesn't feature the FPS counter. Part 2 demonstrates the use of texture mapping.
The dolphin is a 564 polygon mesh, featuring both concave and convex shapes.

Launch
Applet

Launch
Applet

Launch
Applet

Launch
Applet


Next, the famous Newell Teapot, still used as a geometric benchmark for 3D graphics. This version originally had 2976 vertices, but I merged duplicate vertices (often called welding), reducing the number to 529. Not only did this allow the Gouraud shading algorithm to work, it also reduced the file size significantly. The number of polygons remains unchanged at 992.

Launch
Applet

Launch
Applet

Launch
Applet

Launch
Applet


The final applet uses a far more detailed teapot mesh, weighing in at 6320 polygons. It also uses a larger applet window, so you should see a huge drop in FPS.

Launch
Applet

Part 1 - Lighting and Shading
Part 2 - Texture Mapping