1
即時製作一個簡單的XNA遊戲,我一直試圖讓我的世界周圍。 Atm我有一個平坦的地形,即時播放。我想圍繞一個帶有紋理的大圓筒。所以從地形我將能夠看到圓筒內部的紋理。我試圖改變剔除設置,但它沒有工作,或者我做錯了。有關我的繪畫方法應該如何的建議?我需要一個專門製作的模型從裏面顯示嗎? 任何代碼或指向教程將幫助(我已經嘗試了很多)。 謝謝。XNA 4.0繪製缸內模型
我最後一次嘗試的樣本。
private void DrawBackground(Model model)
{
RasterizerState stat = new RasterizerState();
stat.CullMode = CullMode.None;
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.PreferPerPixelLighting = true;
effect.World = Matrix.Identity;
// Use the matrices provided by the game camera
effect.View = gameCamera.ViewMatrix;
effect.Projection = gameCamera.ProjectionMatrix;
}
mesh.Draw();
}