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

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:

I'm legally obligated to by the licenses of the original code I ported from.

I strongly believe in doing my bit to help us all, as the XNA community, to move beyond this kind of entry-level functionality and make some cool games. It makes me happy to know that there are many other people?q=open+source+xna&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a doing the same thing.

In the past I have been one of the people who, when asked if they are going to release something as open source, have answered "yes, I want to, but I'm just going to polish it a little bit more", and then you never hear from them again. No longer - so what I'm releasing may not be bug-free, but I will respond to all comments and logged issues, and hey, it's open source.

1 comment

Gravatar John C Brown
Dec 12, 2010
17:37

I don't have a use for these at the moment but very pleased that you have released them.

Make a comment

Sorry, commenting has been temporary disabled because of spam. If you have any questions, you can email me, and you can also find me on Twitter.