It’s Never Too Late

May 28, 2013

12:22 PM

It’s Never Too Late

This is the last fig leaf.

Yesterday, I went from never having really done any 3D programming to getting a cube up on a display with a simple geometry and fragment shader. That was a great start.

Today my ambition is to entertain some friends, whilst ignoring Twitter as much as I can and importing a textured mesh and displaing that. If things go really well, I’d like to get some kind of ambient occlusion going.

I’m an optimist. And because it shouldn’t be possible, I’m going to do it. Most people confuse the “infeasible for most” with “impossible”. I like reaching for the stars, it’s less crowded up there too.

I understand I need to be able to load an OBJ file and that many 3D packages, like Blender for example, will export these files. I know that meshes have a winding order and that it’s better that a 3D package take care of that rather than do all of this manually. The winding order goes clockwise or counter-clockwise, and depending on that order, a face (triangle) either faces the camera, or doesn’t, in which case it can be culled. Byron assures me that hardware now takes care of that. Having done some preliminary reading on shadow maps, it might still make sense to draw back faces anyway, something to do with rounding errors, but we’ll cross that shadowed bridge when we come to it.

A 3D package will also take care of a normal map and the texture UVs. I’m always happy about a tool that takes away pain. There is no need to inflict pain on yourself. In fact, the first thing I did for Chimera in January 1985 was to write an isometric sprite editor for it, in Z80 assembler, as you do. I wasn’t going to use graph paper (though that had been my preferred method for creating bitmap fonts!)

The Cinder library includes an OBJ loader that allows me access to a TriMesh object directly for OpenGL draw calls. This is fantastic.

So my plan is to make some simple Chimera cubes and apply some simple texture to them, then spit them out of some draw package. Which draw package?

Well Blender is free, and free is good, but the interface is intimidating. It does however make it really easy to create voxel output, which is the kind of look I’ll need for Chimera, even though I don’t know if I’ll be using a voxel technique necessarily.

Then there’s Cheetah3D and there’s Milkshape. I’ve not really looked into Milkshape, but I have a problem with sloppy looking websites, and the Milkshape site looks like something from the ’90s. That doesn’t sound hopeful.

Cheetah3D looks very complete, is available for under £50 on the App Store (remember I’m on a Mac) and does OpenGL preview. Also, unlike Blender, the interface looks Mac native. That means a lot to me. It saves me time when I’m trying to pick something new up.

I might also be able to enlist the help of an architect friend in creating some Chimera objects.

To say I’m excited is an understatement.

I used to be afraid of water. I couldn’t swim most of my life. I’d do anything I could to avoid it. Then I made up my mind at 36 to fix it. Steven Shaw took away my fear of water and eventually, that fear turned into love. I’m not a strong swimmer, or even much of a swimmer, but I’d love to swim every day if it was more convenient. Becoming a swimmer changed my self-image completely. Before, I saw a limit. Suddenly, that limit was gone, along with potentially all other limits. I learned to juggle. Not very well, but I did it. I learned to sing. Not very well, but enough to record demos. Many other barriers have been smashed in my life.

And now I’m removing the last fig leaf. 3D graphics.

Feels good.

Leave a Reply

Your email address will not be published. Required fields are marked *