Пример #1
0
 public Dragonfly(int x_in = 0, int y_in = 0, int z_in = 0)
     : base(x_in, y_in, z_in)
 {
     body = new LitMatrixSphere[6];
     body[0] = new LitMatrixSphere(0.05f);
     body[1] = new LitMatrixSphere(0.04f);
     body[2] = new LitMatrixSphere(0.04f);
     body[3] = new LitMatrixSphere(0.04f);
     body[4] = new LitMatrixSphere(0.04f);
     body[5] = new LitMatrixSphere(0.03f);
     body[0].SetColor(Colors.GREEN_COLOR);
     body[1].SetColor(Colors.DarkOliveGreen);
     body[2].SetColor(Colors.LimeGreen);
     body[3].SetColor(Colors.DarkOliveGreen);
     body[4].SetColor(Colors.LimeGreen);
     body[5].SetColor(Colors.LimeGreen);
     wings = new Triangle3d[2];
     Vector3 a = new Vector3(x - x_step, y + wing_offset + wing_length, z + 0.05f);
     Vector3 b = new Vector3(x, y + wing_offset, z);
     Vector3 c = new Vector3(x + x_step, y + wing_offset + wing_length, z -  0.05f);
     wings[0] = new Triangle3d(a, b, c, true);
     wings[0].SetColor(Colors.LimeGreen);
     Vector3 d = new Vector3(x -x_step, y - wing_offset - wing_length, z -  0.05f);
     Vector3 e = new Vector3(x, y - wing_offset, z);
     Vector3 f = new Vector3(x + x_step, y - wing_offset - wing_length, z +  0.05f);
     wings[1] = new Triangle3d(d,e,f, true);
     wings[1].SetColor(Colors.LimeGreen);
     SetOffsets();
 }
Пример #2
0
 public Triangle3d[] create4Triangles()
 {
     Triangle3d[] four_triangles = new Triangle3d[4];
     Vector3[] new_vertexes = new Vector3[3];
     new_vertexes[0] = (vertices[0] + vertices[1]) /2;
     new_vertexes[1] = (vertices[1] + vertices[2]) / 2;
     new_vertexes[2] = (vertices[2] + vertices[0]) / 2;
     four_triangles[0] = new Triangle3d(vertices[0], new_vertexes[0], new_vertexes[2]);
     four_triangles[1] = new Triangle3d(new_vertexes[2], new_vertexes[0], new_vertexes[1]);
     four_triangles[2] = new Triangle3d(new_vertexes[0], vertices[1], new_vertexes[1]);
     four_triangles[3] = new Triangle3d(new_vertexes[2], new_vertexes[1], vertices[2]);
     return four_triangles;
 }