XNA 怎么添加多个贴图,不是在2D精灵中,是3D渲染
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);
}
心有法竹
浏览 349回答 1
1回答
-
喵喵时光机
推荐一篇参考博文:WP7-XNA 3D开发-基本贴图控制
打开App,查看更多内容