XNA 4.0 Import .X Model easily

After fighting a number of battles with importing models, I was looking for an easy way to import simple 3d models into XNA. 3D Rad Exporter is a free plug-in for Google SketchUp allowing you to save your 3d models as Microsoft DirectX/XNA (.x) files.

Download the plugin from here http://www.3drad.com/files/3DRadExporter.zip

Unzip the 3D Rad Exporter plug-in to the Sketchup Plugin Directory

C:\Program Files\Google\Google SketchUp 8\Plugins

Note that the path to the Google SketchUp plug-in folder may be different if you have installed the program to a location other than the default, or if you use a x86-64 bit version of Windows.

  1. Press [Ctrl]+[A] to select all the elements in the scene
  2. Select Edit -> X Entities (X in model) -> Explode
  3. The plug-in will be available under Plugins and not under Files -> Export, in the Google SketchUp pull-down menu.

To use the image: Open your XNA project, and from the Billboard Content -> right Click -> Add New Item -> Then add your model.x file.

Then add any texture images using Windows Explorer to the content directory manually - if they are not there, compilation will Error.

Assuming, you have your camera and basic game already coded, you can now just load the model using the ContentManager.Load("modelName") function.

Blog tags: 

AttachmentSize
reference.png23.23 KB

Comments

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.