Пример #1
0
        public void RenderFan(
            stVertexAtrribute center,
            stVertexAtrribute bottomLeft,
            stVertexAtrribute leftMid,
            stVertexAtrribute topLeft,
            stVertexAtrribute topMid,
            stVertexAtrribute topRight,
            stVertexAtrribute rightMid,
            stVertexAtrribute bottomRight,
            stVertexAtrribute bottomMid,
            bool drawLeftMid,
            bool drawTopMid,
            bool drawRightMid,
            bool drawBottomMid
            )
        {
            //左边的三角形扇
            if (drawLeftMid)
            {
                RenderTriangle(center, bottomLeft, leftMid);
                RenderTriangle(center, leftMid, topLeft);
            }
            else
            {
                RenderTriangle(center, bottomLeft, topLeft);
            }

            //顶部的三角形扇
            if (drawTopMid)
            {
                RenderTriangle(center, topLeft, topMid);
                RenderTriangle(center, topMid, topRight);
            }
            else
            {
                RenderTriangle(center, topLeft, topRight);
            }

            //右边的三角形扇
            if (drawRightMid)
            {
                RenderTriangle(center, topRight, rightMid);
                RenderTriangle(center, rightMid, bottomRight);
            }
            else
            {
                RenderTriangle(center, topRight, bottomRight);
            }

            //下方的三角形扇
            if (drawBottomMid)
            {
                RenderTriangle(center, bottomRight, bottomMid);
                RenderTriangle(center, bottomMid, bottomLeft);
            }
            else
            {
                RenderTriangle(center, bottomRight, bottomLeft);
            }
        }
Пример #2
0
 public void RenderTriangle(
     stVertexAtrribute a,
     stVertexAtrribute b,
     stVertexAtrribute c
     )
 {
     RenderVertex(a.mVerticeIdx, a.mVertice, a.mUV);
     RenderVertex(b.mVerticeIdx, b.mVertice, b.mUV);
     RenderVertex(c.mVerticeIdx, c.mVertice, c.mUV);
 }