示例#1
0
        private void Init()
        {
            triangles = new STriangle[2];


            triangles[0] = new STriangle();
            triangles[1] = new STriangle();
            Update(position, right, up, forward, scale, materialID);
        }
示例#2
0
        private void Init()
        {
            triangles = new STriangle[4];



            float ho = (float)Math.Sqrt(3) / 2;
            float ht = (float)Math.Sqrt(6) / 3;


            Vector3 v1 = position - up * ht / 4 + forward * ho * 2 / 3;
            Vector3 v2 = position - up * ht / 4 - forward * ho / 3 + right * 0.5f;
            Vector3 v3 = position - up * ht / 4 - forward * ho / 3 - right * 0.5f;
            Vector3 v4 = position + up * ht * 3 / 4;

            triangles[0] = new STriangle(v1, v2, v3, materialID);
            triangles[1] = new STriangle(v4, v2, v3, materialID);
            triangles[2] = new STriangle(v1, v4, v3, materialID);
            triangles[3] = new STriangle(v1, v2, v4, materialID);
        }