Graphics

Games.DiscoverThat.co.uk

JCBDigger's Guides
Graphics
Applications

My preferred tools

There are lots of free applications and tools available on the Internet. Some are good and some are... not yet finished! The following are tools that I find useful and in most cases they are as good as any paid for product. They are more than adequate for the needs of a developer on a budget or even a professional. I like these you may like others.

Blender 3D for use with Microsoft XNA applications

If you want to develope a 3D game you will spend more time creating the content than writing code. I am not an artist but I have found that Blender is a fully featured 3D editor that with a few weeks practice I was able to create models that I could use with XNA.

There are some difficulties with creating 3D models for use with XNA. These are all to do with getting the output in an acceptable format for XNA. Having read a lot of forums it appears all 3D graphics programmes output in slightly different formats even of the same file type. Following the instructions and experiences of others it is as easy as any other to get your Blender model working in XNA with your animations. Many thanks to all those that created exporters and repeated their experience on various forums not to forget to mention the developers who created and continue to develop Blender. The following are a summary of my experiences and some scripts.

Scripts that may help when using Blender to create models for XNA

I have created a few scripts to help me. They may be of use to others but testing has been very limited. Use them at your own risk.

The scripts

Front View +Y up using Number Pad 9 - this is space handler script so has to be included in the text window of each Blend file and turned on for each 3D View window individually. Once activated pressing the Number Pad number 9 will cycle through views one of which is the Front View of a face down +Y up model.

Rotate models to suit XNA - takes a normal Blender facing +Z up model and rotate it to +Y up facing down -Z.

Move object centres to zero (0,0,0) - this suits the FBX for XNA exporter.

The Autodesk FBX exporter with my preferred buttons pushed. I'm making tweaks to this until I have a version that suits me with the minimum number of button pushes to export the way I want it. With very minor changes it is the same script as the FBX for XNA exporter listed on the Blender web site.

Installation

First you'll need the full version of the scripting language 'Python' to use some of these scripts. You must install the matching version for the version of Blender you have. It tells you in the console Window when you start Blender. For example, Blender 2.48 required version 2.5 of Python (the sub version is not critical so version 2.5.2 and version 2.5.4 both work but version 2.6 would not.) Get from Python.org.

In Windows normal scripts are stored in:

C:\%USER%\AppData\[Roaming]\Blender Foundation\Blender\.blender\scripts
Space Handler scripts must be pasted in to a Text window in Blender.

Models

Any test artwork I release will be on my XNA Resources page.

The basics of getting your 3D model to XNA

First thing to note is that Blender works with Z as the up. XNA works with Y as the up.

You will need to create your model in Blender with the head, if it's a humaniod, or the roof, if it's a vehicle or building, facing away (+Y) from the normal front view camera and the eyes, headlights, or front door facing down (-Z)!

It can be awkward to work in Blender this way because the number pad buttons are configured to work Blenders way. I have created a couple of scripts (see above) to help but you may prefer to create the mesh in the normal Blender Z up orientation and then before animating rotate the entire mesh in Edit Mode to face the XNA orientation.

Note that I said BEFORE ANIMATION. If you rotate after creating animations those actions often get in a muddle. I also said in Edit Mode. You need to leave the rotation at Zero for the object. The Export to Autodesk FBX has some limitations one of which is that the animations of objects with a rotation that is not zero (0,0,0) often go off in unexpected directions. The centre of all objects also needs to be set to Zero. Again that is a limitation of the way the FBX exporter works in conjunction with the FBX processor in XNA.

Summary:

The above summary works with the Microsoft XNA SkinningSample.


See also, other sites hosted here.    All content ©copyright 2009