Tutorial 2.1: Adding The Model To The Scene
Drawing models with the X-Engine is an incredibly simple thing to do. To follow along with this tutorial, you will need at least an XNA Game with the Engine Loaded into it. You can get this by following the first tutorial series, or by downloading the sample from Tutorial 1.3: Integrating the X-Engine into the project.
  • The first thing you need is a model to draw. I have included one you can use here: Ship.zip. The first thing you need to do is extract the model and its texture to somewhere on your computer. Than go back to visual C# and right click "Content" in the solution explorer, and choose "Add Existing Item". Browse to the model and texure you extracted and add them both.
  • Now that the model is loaded. We add it to our scene. Do this by adding the following code to your Initialize() function
XScene.AddModel("ShipModel", "Ship");

The first parameter specifies a name we will use when referencing the model. The second parameter is it's filename. We can simply use "Ship", and the X-Engine will take care of loading it.

The next tutorial will show you how to add an actor that uses this model to draw it on screen. Tutorial 2.2: Adding an actor to the scene

Last edited Mar 23, 2008 at 6:48 AM by Hazardous101, version 3

Comments

No comments yet.