- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
顶点定义与基本形状汇出
* 範例二:顯示出三個軸線 4.在draw()定義世界矩陣與投影矩陣,並顯示出結果 protected override void Draw(GameTime gameTime) { …….. // Draw the 3D axis effect.Begin(); foreach (EffectPass CurrentPass in effect.CurrentTechnique.Passes) { CurrentPass.Begin(); graphics.GraphicsDevice.DrawPrimitives(PrimitiveType.PointList, 0, 6); CurrentPass.End(); } effect.End(); base.Draw(gameTime); } } * 範例三:顯示出一個立方體 1. 定義八個頂點 2. 定義十二個三角形,其中兩個三角形形成一平面 3. 繪出 * 範例三:顯示出一個立方體 定義八個頂點 protected override void Initialize() { ……… VertexPositionColor[] vertices = new VertexPositionColor[8]; // X, Y, Z axis vertices[0] = new VertexPositionColor(new Vector3(-1.0f, -1.0f, -1.0f), Color.White); vertices[1] = new VertexPositionColor(new Vector3(-1.0f, 1.0f, -1.0f), Color.White); vertices[2] = new VertexPositionColor(new Vector3(1.0f, 1.0f, -1.0f), Color.White); vertices[3] = new VertexPositionColor(new Vector3(1.0f, -1.0f, -1.0f), Color.White); vertices[4] = new VertexPositionColor(new Vector3(-1.0f, -1.0f, 1.0f), Color.White); vertices[5] = new VertexPositionColor(new Vector3(-1.0f, 1.0f, 1.0f), Color.White); vertices[6] = new VertexPositionColor(new Vector3(1.0f, 1.0f, 1.0f), Color.White); vertices[7] = new VertexPositionColor(new Vector3(1.0f, -1.0f, 1.0f), Color.White); vertexBuffer = new VertexBuffer(this.GraphicsDevice, 8*VertexPositionColor.SizeInBytes, BufferUsage.WriteOnly); // 產生 頂點緩衝區 vertexBuffer.SetDataVertexPositionColor(vertices); // 複製 頂點資料 * 範例三:顯示出一個立方體 2. 在initialize定義六個平面,共十二個三角形 short[] vertexIndices = new short[36]; // 36 個 頂點索引 vertexIndices[0] = 3; vertexIndices[1] = 2; vertexIndices[2] = 1; // 後面 vertexIndices[3] = 3; vertexIndices[4] = 1; vertexIndices[5] = 0; vertexIndices[6] = 4; vertexIndices[7] = 5; vertexIndices[8] = 6; // 前面 vertexIndices[9] = 4; vertexIn
您可能关注的文档
最近下载
- 浅表淋巴结结核的诊断与治疗专家共识.pptx VIP
- 标准图集-11K406-暖,冷风机选用与安装.pdf VIP
- 患者隐私保护培训课件(精).pptx VIP
- 2024年烟草公司笔试试题真题(附答案).docx VIP
- 实景三维地理信息数据倾斜摄影测量技术规程.pdf VIP
- 化学-郑州外国语中学2024-2025学年高一上学期10月月考.pdf VIP
- 中职思想政治高教版(2023)哲学与人生 第三课 追求人生理想 教案(表格式).doc.docx VIP
- 七夕情人节牛郎织女小报手抄报word电子模板黑白线稿横版竖版涂色 (1).docx VIP
- 歌曲二胡曲谱.doc VIP
- 财务会计学习指导、习题与实训第六版王宗江习题答案.docx
文档评论(0)