hier dat arktikel
http://www.xnamag.de/article.php?aid=24
Code: Alles auswählen
MyModel model1;
Model myModel;
Matrix worldMatrix;
Matrix viewMatrix;
Matrix projectionMatrix;
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
// TODO: use this.Content to load your game content here
myModel = Content.Load<Model>("modelAsset.x"); //Hier NULL POINTER
worldMatrix = Matrix.CreateRotationY(4.0f) * Matrix.CreateTranslation(new Vector3(1.0f, 1.0f, 1.0f));
viewMatrix = Matrix.CreateLookAt(new Vector3(1.0f, 10.0f, 0.0f), new Vector3(1.0f, 1.0f, 1.0f), Vector3.Up);
projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f), 800.0f / 600.0f, 1.0f, 100.0f);
}