我是XNA的新手,我尝试加载模型,但没有正确加载。
该模型在visual studio中看起来像这样:
当我尝试显示时,它看起来像这样:
我的代码是:
Matrix[] transforms = new Matrix[BilliardTable.Bones.Count];
this.BilliardTable.CopyAbsoluteBoneTransformsTo(transforms);
foreach (ModelMesh mesh in this.BilliardTable.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.World = transforms[mesh.ParentBone.Index] *
Matrix.CreateRotationX(120)
* Matrix.CreateTranslation(Vector3.Zero);
effect.View = Matrix.CreateLookAt(balls.First().cameraPosition,
Vector3.Zero, Vector3.Up);
effect.Projection = Matrix.CreatePerspectiveFieldOfView(
MathHelper.ToRadians(45.0f), balls.First().aspectRatio,
1.0f, 10000.0f);
}
mesh.Draw();
}