Multiplatform low-resolution 3d engine. For losers, by losers.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

wannabe

Multiplatform low-resolution 3d engine. For losers, by losers.

Code

Right now, this is simply a collection of little classes.

  • A Position holds x, y, and z locations.
  • A Voxel is a Position and a color.
  • A Grid is a collection of Voxels

Then there's how to display these:

  • A Camera keeps track of where we're looking.
  • A Projection converts a Position to a pixel location, given a Camera and a pixel size. There's Flat, Cabinet, and PseudoPerspective Projections.
  • A UI keeps track of the Grid, the Camera, and the Projection, and actually renders the result.

Samples

You can run SwingWannabe, a java-AWT and Swing implementation that I'm using as my testbed. It has a number of sample Grids, including a heightmap and displays the resulting Grid. I went ahead and implemented 8 different render modes (shown here with the Cabinet projection).

Original heightmap:

Original Heightmap

wannabe rendering the upper-left 50x50 pixels or so. Render modes: circles, rounded-squares, squares, and "3d" squares.

fillCircle fillRoundRect fillRect fill3dRect

And there's non-filled versions of the same shapes:

circle roundRect rect 3drect

Limitations

As you can see from the samples, this isn't really meant to be a photorealistic engine. It's geared more for pixel-art and retro-style visuals, but allows for some nifty things.

Grids should be considered the smallest practical unit of animation. Voxels inside a grid shouldn't move relative to one another. Some grids can support adding and removing voxels, but a voxel should only be in a single Grid.

My expectation is that the camera will always be looking down the z-axis. The position of the camera may change, but not the direction.

Why?

I don't have a better answer here than what I've said. This is a way to learn some little bits about 3d graphics while working in a simple space. And potentially it can be a good platform from which to develop some small games.

License

I chose the MIT license at this time. Please contribute back fixes you come across!