首页 新闻 赞助 找找看

XNA 怎么添加多个贴图,不是在2D精灵中,是3D渲染

0
悬赏园豆:15 [已解决问题] 解决于 2013-08-20 17:54
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<VertexPositionTexture> (PrimitiveType.TriangleStrip, verts, 0, 2); } base.Draw(gameTime); }
大芝麻的主页 大芝麻 | 初学一级 | 园豆:4
提问于:2013-08-20 15:26
< >
分享
最佳答案
1

推荐一篇参考博文:WP7-XNA 3D开发-基本贴图控制

收获园豆:15
dudu | 高人七级 |园豆:31075 | 2013-08-20 17:44

就是这个。。。谢谢大能!!!!

大芝麻 | 园豆:4 (初学一级) | 2013-08-20 17:54
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册