Пример #1
0
 public RubikCube(int rank_num = 3, int edge = 150)
 {
     rank = rank_num;
     double temp = rank_num * edge / 2.0;
     // initial cuboids
     cuboids = new Cuboid[rank, rank, rank];
     ForEach((i, j, k) =>
     {
         var cub = new Cuboid(edge, edge, edge);
         cub.MoveBy(i * edge - temp, j * edge - temp, k * edge - temp);
         cub.DrawingLine = true;
         cub.FillingFace = false;
         cuboids[i, j, k] = cub;
     });
     // default center is 0,0,0
     center = new Point3D(0, 0, 0);
 }
Пример #2
0
 private void button14_Click(object sender, EventArgs e)
 {
     cub = new Cuboid(150, 150, 150);
     cam = new Camera();
     cub.Center = new Point3D(400, 240, 0);
     cam.Location = new Point3D(400, 240, -500);
     ReDraw();
     i = 0;
     bmp = new Bitmap[6];
     labelMx.Text = cam.Location.X.ToString();
     labelMy.Text = cam.Location.Y.ToString();
     labelMz.Text = cam.Location.Z.ToString();
     labelCx.Text = cub.Center.X.ToString();
     labelCy.Text = cub.Center.Y.ToString();
     labelCz.Text = cub.Center.Z.ToString();
     cameraX = 0; cameraY = 0; cameraZ = 0; cubeX = 0; cubeY = 0; cubeZ = 0;
     labelCrX.Text = "0";
     labelCrY.Text = "0";
     labelCrZ.Text = "0";
     labelMrX.Text = "0";
     labelMrY.Text = "0";
     labelMrZ.Text = "0";
 }