protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
// Set the vertex buffer on the GraphicsDevice
GraphicsDevice.SetVertexBuffer(vertexBuffer);
//Set object and camera info
effect.World = worldRotation * worldTranslation * worldRotation;
effect.View = camera.view;
effect.Projection = camera.projection;
effect.Texture = texture;//這里設(shè)置貼圖對(duì)象,可是如果有多張貼圖呢怎么辦 //efect對(duì)象只有一個(gè)呀 難道這個(gè)從設(shè)備獲取的對(duì)象可以定義多個(gè)嗎
effect.TextureEnabled = true;
// Begin effect and draw for each pass
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.DrawUserPrimitives
(PrimitiveType.TriangleStrip, verts, 0, 2);
}
base.Draw(gameTime);
}
- 1 回答
- 0 關(guān)注
- 368 瀏覽
添加回答
舉報(bào)
0/150
提交
取消