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;//这里设置贴图对象,可是如果有多张贴图呢怎么办 //efect对象只有一个呀 难道这个从设备获取的对象可以定义多个吗
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);
}
添加回答
举报
0/150
提交
取消