第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

MonoGame:渲染 3d 模型和 spritebatch 的問題

MonoGame:渲染 3d 模型和 spritebatch 的問題

C#
蕭十郎 2023-05-14 16:51:29
我想在屏幕上繪制一些調(diào)試信息,但這會導致渲染模型出現(xiàn)問題。我在互聯(lián)網(wǎng)上找到了一些解決方案,但它不起作用。也許我太笨了,但我不知道出了什么問題。這是繪制方法:    protected override void Draw(GameTime gameTime)    {        GraphicsDevice.Clear(Color.DarkCyan);        spriteBatch.Begin();        player.Draw(dt);        spriteBatch.DrawString(gamefont, "render Time :" + gameTime.ElapsedGameTime.TotalSeconds, new Vector2(0, 85), Color.White);        spriteBatch.End();        effect.View = player.view;        effect.Projection = player.projection;        effect.Texture = dirtTexture;        GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp;        GraphicsDevice.BlendState = BlendState.Opaque;        GraphicsDevice.DepthStencilState = DepthStencilState.Default;        foreach (EffectPass p in effect.CurrentTechnique.Passes)        {            p.Apply();            effect.World = player.world;            GraphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, buffer.VertexCount / 3);        }        base.Draw(gameTime);    }這是它的樣子
查看完整描述

1 回答

?
小唯快跑啊

TA貢獻1863條經(jīng)驗 獲得超2個贊

三角形法線(正面)被向后繪制。這是由頂點緩沖區(qū)中頂點的順序定義的。

幸運的是,我們可以在GraphicsDevice. 只需添加以下行:

GraphicsDevice.RasterizerState = RasterizerState.CullCounterClockwise;

如果給出相同的結(jié)果,請使用:

GraphicsDevice.RasterizerState = RasterizerState.CullClockwise;


查看完整回答
反對 回復 2023-05-14
  • 1 回答
  • 0 關注
  • 235 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號