2
我想知道下面使用的方法是在繪製屏幕之前確定模型位置的正確方法。 因爲當我想創建一個複製我的模型的地板。我發現自己面臨着「Z戰鬥」問題^^。在xna項目中配置模型/紋理位置的最佳方法是什麼
非常感謝你
代碼示例ST位置上我的模型繪製前:
model_Position.X = (float) 1.0;
model_Position.Z = (float) 3.0;
model_Position.Y = (float) 5.0;
// Draw the model. A model can have multiple meshes, so loop.
foreach (ModelMesh mesh in model_ground_land1.Meshes)
{
// This is where the mesh orientation is set, as well
// as our camera and projection.
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.World = transforms[mesh.ParentBone.Index] *
Matrix.CreateRotationY(model_Rotation) * Matrix.CreateTranslation(model_Position);
effect.View = View;
effect.Projection = Projection;
}
// Draw the mesh, using the effects set above.
mesh.Draw();
}
thanksss man ;-)!你的權利 –