For casual 3D modelers, Google SketchUp is a good alternative to more complicated and robust software such as Blender and Maya.
For developers who prefer to get decent looking models up and spend their time writing code, then SketchUp could be used to assist in visualizing their concept.
You can use the free version of Google SketchUp to export to the Microsoft DirectX .X format by using a custom built plug-in. I’ll describe the steps below, but if you are just looking for the plug-in then it can be found at:
The script was created by r1kdou (of XNA forums). You can view his original post here.
Installation & Setup
First, install Google SketchUp, install the above plug-in (just copy it to the <Google SketchUp install directory>/plugins folder).
Finding & Loading the Model
Next create your own or find a model via Google SketchUp warehouse. There’s tons of free models built by users and you’ve bound to find at least one or two you can use.
Here’s a good looking model that I’ll be using:
Export To DirectX
Next, export the model to .X format by choosing the “Export DirectX” menu choice in the “Plugins” menu.
Loading the Model into your XNA Game
Finally, copy the .x file to your “Content” folder, and include it in your project using the default “X File – XNA Framework” content importer and “Model – XNA Processor” content processor.
Don’t forget to include any texture files that the model requires. If you don’t know which textures are in use, you can open the .X file using Notepad and see the TextureFilename values (listed at the top of the .X file).
Place the textures in the same directory as the .X file, but you don’t need to add the texture images to your XNA project. Also, make sure your image dimensions are all resized to a power of 2 (2, 8, 16, 32, 64, 128, 256, etc.).
You will get a compile error if you are missing texture files or an image size is not a power of 2.
Viewing the Model in your XNA Game
Assuming, you have your camera and basic game already coded, you can now just load the model using the ContentManager.Load<Model>(“modelName”) function.
Here’s a screen capture of the above model loaded into my current game framework. You may recognize the terrain and skydome from the XNA Generated Geometry sample.
You can also use Google SketchUp for designing entire levels. I’m unsure of the speed involved in loading a level of that size, but hopefully (one day), I’ll test that out when my game makes a little more progress.