3DS, OBJ, and NFF content importers for XNA 4.0

November 20, 2010

Continuing my recent hobby of digging up old projects and releasing them, I want to mention a couple of content importers that I have been working on.

I'd like to preface this by saying that I've acted as an aggregator; most of this code was ported from somebody else's work, as I have acknowledged below. If there are any bugs, they are almost certainly my fault, and if you find one please log an issue.

So the 3 content importers I've added to Osiris (my catch-all project for XNA content pipeline extensions, including the terrain geomipmapping processor) are:

# A material
f 0.3 0.3 0.3 0.8 0.2 16 0

# A plane at 0 0 0 with a 'width' of 50 and 'height' of 40
x-plane 0 0 0 50 40

# A red material
f 0.8 0.1 0.1 0.8 0.2 16 0

# A cube at -50 0 0 with a 'size' of 50
x-cube -50 0 0 50

# A green material
f 0.1 0.8 0.1 0.8 0.2 16 0

# A teapot at 50 0 0 with a 'size' of 50, with a tessellation level of 10
tess 10 x-teapot 50 0 0 50

The available primitives are:

And before you ask, yes, the code for these is adapted from the Primitives3D sample on App Hub. Like I said, most of what I've done with these importers is package up other people's work, in a hopefully easy to use way.

As with all the software in my recent posts, this code is open source and hosted on GitHub. If you dig through the code, you might notice that it calls out to two other libraries called Meshellator and Nexus. These are two other open source projects I'm working on, but I'm not ready to talk about them in any great detail. The reason I've abstracted the mesh importing away from XNA is that I use the same library for a nascent software rasterizer.

On a tangential note, I have three reasons for releasing this software as open source:

comments powered by Disqus