亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

OpenGL (ES)如何自定義繪制方法?

OpenGL (ES)如何自定義繪制方法?

JustV 2016-09-23 14:23:53
public?void RecursRender(?TriTreeNode?tri,?int?leftX,?int?leftY,?int?rightX,?int?rightY,?int?apexX,?int?apexY,?GL10?gl?){ //方法定義時使用GL10?gl作為參數沒有報錯 ????????????????????????????????if?(?tri.LeftChild?!=?null?) int?centerX?=?(leftX?+?rightX)>>1; int?centerY?=?(leftY?+?rightY)>>1; RecursRender(?tri.LeftChild,??apexX,???apexY,?leftX,?leftY,?centerX,?centerY,?GL10?gl?); RecursRender(?tri.RightChild,?rightX,?rightY,?apexX,?apexY,?centerX,?centerY,?GL10?gl?); }//在此處迭代調用該函數時,參數GL10?gl處提示錯誤GL10?cannot?be?resolved?to?a?variable else { //?Actual?number?of?rendered?triangles... landscape.gNumTrisRendered++; float?leftZ??=?m_HeightMap[(leftY?*MAP_SIZE)+leftX?]; float?rightZ?=?m_HeightMap[(rightY*MAP_SIZE)+rightX]; float?apexZ??=?m_HeightMap[(apexY?*MAP_SIZE)+apexX?]; List<Float>?coordsList?=?new?ArrayList<Float>(); coordsList.add((float)leftX); coordsList.add((float)leftY); coordsList.add(leftZ); coordsList.add((float)rightX); coordsList.add((float)rightY); coordsList.add(rightZ); coordsList.add((float)apexX); coordsList.add((float)apexY); coordsList.add(apexZ);????????????//將三角形三個點存入待繪制頂點序列 gl.glVertexPointer(3,?GL10.GL_FLOAT,?0,?BufferUtil.list2ByteBuffer(coordsList)); gl.glDrawArrays(GL10.GL_LINE_LOOP,?0,?coordsList.size()/3); } }總結一下,問題就是1.OpenGL ES庫里的GL10 gl這個參數可以用來自己定義繪制方法么?2.如果可以,那為什么在迭代函數里不能第二次調用呢?慕課上肯定有做移動端3D游戲的大神吧?小弟誠心求助!
查看完整描述

目前暫無任何回答

  • 0 回答
  • 2 關注
  • 2199 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號