
This tutorial is a series of programs that demonstrate step by step how to make 3D graphics in Java without using external libraries except for the standard Java implementation (basically Swing and AWT). This means that you just need to have Java installed to compile and execute these programs. Because there are no external libraries, you shouldn't have any problems to compile in future Java versions. All programs were written with Netbeans. If you have Netbeans installed then you just need to open the included project and compile it, if you use any other IDE, you just need to create a project that includes all source code files.
This is a list of the things I did using this library.
Saturn.
Same sphere as part 10, with Saturn's texture. Additionally, the ring was created in a similar way that a sphere is created, but only 2 flat circles are described. The texture of the ring is an image with transparency. I also created an extra triangle rasterizer that reads the alpha channel of the texture in order to show a semi-transparent ring.
Earth with clouds.
Very similar to part 10 of the tutorial, with the addition of multiple textures, the program changes the texture every 3 frames. The hard part was to get real time images of the earth taken every 15 minutes, the images were taken from NOAA. The demo uses around 3.5 GB of RAM for the textures, which definitely needs a 64-bit JVM, but the result looks great. The total size used by all the images is around 3GB.
2D screen with 3D animation.
This is an idea I had to transform an ordinary screen into a 3D one and use as a transition animation, the problem I wanted to solve was how to position the camera so that the resulting image matches the size of the canvas and looks like a 2D image.
Remake of tutorial's part 1.
This is the first demo of the tutorial remade in 3D. When I published the first demo, very few people paid attention, because it was so simple that most didn't find it interesting, but reality is that the concepts presented are the base for all of the demos. Anyway, our ball got sad, and it reclaimed for a second chance that could be titled as "The revenge of the bouncing ball". Once you understand 3D concepts, its as easy as the 2D version, because all the 3D stuff is done by the library, you only add an extra Z dimension to the algorithm. Additionally, you need extra code to handle the camera movements but nothing more than interpolating angles and positions.
Raiders 3D game.
This is a Java port of the Raiders 3D demo published in the book "Tricks of the 3D Game Programming Gurus" by André Lamothe.
Wave Raider game.
This is a Java port of the Wave Raider demo published in the book "Tricks of the 3D Game Programming Gurus" by André Lamothe.
MD2 Animation.
This is a Java port of the MD2 Animation demo published in the book "Tricks of the 3D Game Programming Gurus" by André Lamothe.
MD2 is a popular file format used in the Quake game. The demo also shows a technique to display shadows. Actually, animating objects is easy because its just a collection of polygons that change, just like 2D animations. The hard part is creating those sequences.
ESP8266 Demo.
Demonstration of the 3D library ported to an ESP8266 microcontroller connected to a 2.2" TFT SPI screen with 16-bit graphics. The program is not written in Java, it was made in C++, but the point is: Why would you want to learn 3D graphics from scratch if there are libraries that do the job with accelerated hardware? If you have access to a display and you can draw a pixel, then you have all you need to create a 3D animation.
Vortex Demo.
With this demo I wanted to create an animation composed of multiple objects and see how many polygons can be rendered with a software rasterizer with an acceptable framerate. The demo creates different geometric objects (cubes, cones, spheres and cylinders) with and without textures, it basically uses all the techniques discussed in the lessons. Rendering was done at 24 bits which simplifies the code and increases performance.
How to create a torus.
Creating geometric objects has been an good exercise to understand 3D graphics, and one of those exercises was creating a torus object. I'm thinking of extending the tutorials to include the full description of this and other objects (cube, cone and cylinder).
Ancient scroll.
I've always liked graphics effects involving paper and scrolls, but almost all that I've seen are limited to animating a scroll just to create a plain space where text can be drawn, so I wanted to make an animation where the text follows the shape of the paper which shouldn't be a 2D plane. I still want to animate the scrolling and unrolling of the paper but this is a beginning...