[media]http://www.youtube.com/watch?v=bWns6yyMtvQ[/media]
Edit: I've also managed to get this going. This is a bit fancier, but not much and still a bit clippy:
[media]http://www.youtube.com/watch?v=Md3hzeZQB3I[/media]
So I posted this awhile back saying 'don't get excited', but everyone did anyway and then I got excited so I kept going and it turns out it is pretty cool, and it's moderately reliable. The engine is capable of taking in a series of vertices the user specifies, and a series of indices that specify a triangle list. That list is turned into a face list, which is culled, sorted, projected and rasterized.
The end result means you can create a 3D model of any shape, convex or concave provided that none of the faces intersect. It will not handle that gracefully.
It still has issues as well. Culling doesn't take projection into account so sometimes faces perpendicular to the camera will either not be visible or slightly clip the nearby shape. The triangle fill isn't pixel perfect either- don't expect that, so if you do a wireframe you'll see a few errant pixels outside. So work to be done but it's a promising start.
If you want to muck around with it yourself I've uploaded to code. You need the following:
- render, the executable, at: http://pastebin.com/pRH1A3Hc
- matrix, an API that calculates the transformations, at: http://pastebin.com/a73J8Ndm
- graphics, an API, at: http://pastebin.com/DTxxgZjc
- vertex, another API that doesn't really do anything at the moment but may one day: http://pastebin.com/237H8vGU
Making your own models is a chore. If you've done it manually in XNA or OpenGL before you can have a go but I really don't recommend it. That TIE fighter took about a half hour. But the code is free for you to play with, as always.
-NF