3D Cube Engine - Java

Posted on by Kenny Cason
tags = [ 3d, development, game, graphics, java, rotation, rubiks cube, vector ]

This is a recent project of mine for building 3D puzzle games, (like Rubik’s Cubes).

While the code could be optimized quite a bit, this is mainly for those who wish to better understand concepts of 3D programming. For example, one way to create, store, and manipulate a 3D polygon, whether it be a Cube, or an ellipsoid. This project contains code and algorithm’s to rotate 3D polygons, around the origin, and themselves. Ability to draw 3D objects in order of increasing Z-values. Draw wireframe or solid color polygons. Keyboard and Mouse controls to move and alter the Polygons. It is a work in progress and not intended for use in graphic intensive games.

Note: later I will add rotateAroundVector() for more general rotation Note: Ellipse3D is still very primitive but demonstrates one method creating an ellipsoid Note: Not all Jar files contain the same versions of code. Each Jar file contains code specific to what it is supposed to do.

All source code can be found in the JAR files Downloadable Jars (simple to complex): 1. RenderWiredCubes3D-demo.jar: this code rotates 4 rotating cubes about the origin. 2. RenderPolygons3D-demo.jar: this code demonstrates various ellipsoids and cubes rotating around unique axises. 3. Cubes3D-demo.jar: this code demonstrates more of the functionality of the 3D Cube engine by creating a Rubik’s cube like look and feel. Controls If you’re only interested in the Transformation algorithms, check the below link: Graph4D - demonstrates methods and actual source code for rotating a 4D vector. Graph3D - demonstrates methods and actual source code for rotating a 3D vector.
comments powered by Disqus