hubo5563 发表于 2011-4-20 16:27:02

我的魔方系列仿真程序和演示软件的立体模型(纸质)


        设计一个五魔方的仿真程序需要编正十二面体的切割编码模型,为此我用硬纸做了n多个如下的模型:
        这个是五魔方的模型原型,五魔方java程序就是根据它编的,其中黑色是面的编号,上面有点的编号,也有面的编号。除了计算这些点的立体坐标外,还要确定各个面是由那些点组成的,需要构造相应的数组。另外当转动五魔方时,这些面要做相应的置换,需要处理各个面转动时的面编号置换,只有在立体模型下,才能构造出正确的置换数组。


    下面是一个魔中魔五魔方的立体模型。这个是用软件画的图,贴到硬纸上可以做硬纸模型。

     下面是转角五魔方的立体模型。

      还有很多,就不上图了。

hubo5563 发表于 2011-4-20 16:31:09

第一个是如下魔方的模型:

1
10
99d658
f3a0e2


第二个是如下魔方的模型:

17
10
99d658
f3a0e2

k789m 发表于 2011-4-20 16:31:39

哇~很复杂吧
我想都不敢想

hubo5563 发表于 2011-4-20 16:35:34

原帖由 k789m 于 2011-4-20 16:31 发表 http://bbs.mf8-china.com/images/common/back.gif
哇~很复杂吧
我想都不敢想
是很复杂的,这些数据有一个不对都不行。
//以下是每转动一层一个顺时针72度后,新的魔方各个面颜色的轮换,12个面,共12个轮换的数据
private static final short[][] lh={
{13,14,15,16,17, 73,74,75,76,77, 18,23,28,33,38, 22,27,32,37,42, 78,87,92,97,102},
{18,19,20,21,22, 78,79,80,81,82, 13,41,47,52,23, 42,43,48,24,14, 73,101,107,112,83},
{23,24,25,26,27, 83,84,85,86,87, 15,22,52,53,29, 14,21,51,57,28, 74,82,111,117,88},
{28,29,30,31,32, 88,89,90,91,92, 15,26,56,61,33, 16,27,57,62,34, 75,86,116,122,93},
{33,34,35,36,37, 93,94,95,96,97, 16,31,60,66,38, 17,32,61,67,39, 76,91,121,127,98},
{38,39,40,41,42, 98,99,100,101,102, 18,17,36,65,43, 13,37,66,44,19, 77,96,126,103,79},
{43,44,45,46,47, 103,104,105,106,107, 71,48,19,40,64, 72,49,20,41,65, 108,80,100,125,132},
{48,49,50,51,52, 108,109,110,111,112, 20,46,70,53,24, 47,71,54,25,21, 81,106,131,113,84},
{53,54,55,56,57, 113,114,115,116,117, 29,25,50,69,62, 26,51,70,58,30, 85,110,130,118,89},
{58,59,60,61,62, 118,119,120,121,122, 34,30,55,68,67, 35,31,56,69,63, 94,90,115,129,123},
{63,64,65,66,67, 123,124,125,126,127, 35,59,72,44,39, 36,60,68,45,40, 120,128,104,99,95},
{68,69,70,71,72, 128,129,130,131,132, 64,59,55,50,46, 63,58,54,49,45, 124,119,114,109,105}
};
//以下是以6个轴为旋转轴的所有角块的转动变换的轮换数据
private static final  short[][] jkbh={
//1:
{23,28,33,38,18,   22,27,32,37,42,   14,15,16,17,13,
21,26,31,36,41,   24,29,34,39,19,   52,57,61,66,43,
47,51,56,60,65,   20,25,30,35,40,   48,53,62,67,44,
46,50,55,59,64,   49,54,58,63,45,   71,70,69,68,72},
//2:
{43,48,24,14,42,   41,47,52,23,13,   19,20,21,22,18,
44,49,25,15,38,   40,46,51,27,17,   65,71,53,28,37,
66,72,54,29,33,   36,64,70,57,32,   39,45,50,26,16,
67,68,55,30,34,   35,63,69,56,31,   60,59,58,62,61},
//3:
{15,22,52,53,29,   28,14,21,51,57,   27,23,24,25,26,
32,13,20,50,56,   16,18,48,54,30,   33,42,47,70,62,
34,38,43,71,58,   61,37,41,46,69,   31,17,19,49,55,
60,36,40,45,68,   35,39,44,72,59,   67,66,65,64,63},
//4:
{16,27,57,62,34,   33,15,26,56,61,   32,28,29,30,31,
17,23,53,58,35,   37,14,25,55,60,   38,22,51,69,67,
39,18,52,70,63,   66,42,21,50,68,   36,13,24,54,59,
40,19,48,71,64,   65,41,20,49,72,   44,43,47,46,45},
//5:
{17,32,61,67,39,   38,16,31,60,66,   37,33,34,35,36,
13,28,62,63,40,   42,15,30,59,65,   18,27,56,68,44,
19,23,57,69,45,   43,22,26,55,72,   41,14,29,58,64,
20,24,53,70,46,   47,21,25,54,71,   48,52,51,50,49},
//6:
{13,37,66,44,19,   18,17,36,65,43,   42,38,39,40,41,
14,33,67,45,20,   22,16,35,64,47,   23,32,60,72,48,
24,28,61,68,49,   52,27,31,59,71,   21,15,34,63,46,
25,29,62,69,50,   51,26,30,58,70,   53,57,56,55,54}
};
//以下是以6个轴为旋转轴的所有棱块的转动变换的轮换数据
private static final  short[][] bkbh={
//1:
{73,74,75,76,77,        78,87,92,97,102,
82,86,91,96,101,       83,88,93,98,79,
80,84,89,94,99,        107,111,116,121,126,
81,85,90,95,100,       112,117,122,127,103,
106,110,115,120,125,   108,113,118,123,104,
109,114,119,124,105,   131,130,129,128,132},
//2:
{78,79,80,81,82,        73,101,107,112,83,
77,100,106,111,87,     102,103,108,84,74,
75,98,104,109,85,      92,96,125,131,117,
76,99,105,110,86,      97,126,132,113,88,
91,95,124,130,116,     93,127,128,114,89,
94,123,129,115,90,     121,120,119,118,122},
//3:
{83,84,85,86,87,        82,111,117,88,74,
81,110,116,92,73,      112,113,89,75,78,
79,108,114,90,76,      101,106,130,122,97,
80,109,115,91,77,      107,131,118,93,102,
100,105,129,121,96,    103,132,119,94,98,
104,128,120,95,99,     125,124,123,127,126},
//4:
{88,89,90,91,92,        86,116,122,93,75,
85,115,121,97,74,      117,118,94,76,87,
83,113,119,95,77,      82,110,129,127,102,
84,114,120,96,73,      111,130,123,98,78,
81,109,128,126,101,    112,131,124,99,79,
108,132,125,100,80,    106,105,104,103,107},
//5:
{93,94,95,96,97,        91,121,127,98,76,
90,120,126,102,75,     122,123,99,77,92,
88,118,124,100,73,     86,115,128,103,78,
89,119,125,101,74,     116,129,104,79,87,
85,114,132,107,82,     117,130,105,80,83,
113,131,106,81,84,     110,109,108,112,111},
//6:
{98,99,100,101,102,     96,126,103,79,77,
95,125,107,78,76,      127,104,80,73,97,
93,123,105,81,74,      91,120,132,112,87,
94,124,106,82,75,      121,128,108,83,92,
122,129,109,84,88,     90,119,131,111,86,
118,130,110,85,89,     115,114,113,117,116}   
};
private static final int[] bhsy={3,4,5,1,2,0};
//点变换数据,每3个一组,第一个数是要计算的三维点序号,第二个数是采用的变换,为1采用dbh1来变换第三个数为三维点序号,
//为2采用dbh2来变换第三个数为三维点序号,第三个数是利用的三维点序号
//第一阶段用的变换数据
private static final short[][] bh1={
{7,1,6},  {8,1,7},  {9,1,8},  {10,1,9}
};
//第二阶段用的变换数据
private static final short[][] bh2=
{
{12,1,11},  {13,1,12},  {14,1,13},  {15,1,14},
    {17,1,16},  {18,1,17},  {19,1,18},  {20,1,19}
};
//第三阶段用的变换数据
private static final short[][] bh3=
{
{2,1,1},  {3,1,2},  {4,1,3},  {5,1,4}
};

[ 本帖最后由 hubo5563 于 2011-4-20 16:39 编辑 ]

hubo5563 发表于 2011-4-20 16:40:22

//第四阶段用的变换数据
private static final short[][] bh4=
{
{21,2,15},  {22,1,21},  {23,1,22},  {24,1,23},  {25,1,24},
{26,2,5},   {27,1,26},  {28,1,27},  {29,1,28},  {30,1,29},
{31,2,4},   {32,1,31},  {33,1,32},  {34,1,33},  {35,1,34},
{36,2,20},  {37,1,36},  {38,1,37},  {39,1,38},  {40,1,39},
{41,2,1},   {42,1,41},  {43,1,42},  {44,1,43},  {45,1,44},
{46,2,3},   {47,1,46},  {48,1,47},  {49,1,48},  {50,1,49},
{51,2,6},   {52,1,51},  {53,1,52},  {54,1,53},  {55,1,54},
{56,2,2},   {57,1,56},  {58,1,57},  {59,1,58},  {60,1,59},
{61,2,11},  {62,1,61},  {63,1,62},  {64,1,63},  {65,1,64},
{66,2,16},  {67,1,66},  {68,1,67},  {69,1,68},  {70,1,69},
{71,2,12},  {72,1,71},  {73,1,72},  {74,1,73},  {75,1,74},
{76,2,17},  {77,1,76},  {78,1,77},  {79,1,78},  {80,1,79},
{81,2,7},   {82,1,81},  {83,1,82},  {84,1,83},  {85,1,84},
{86,2,26},  {87,1,86},  {88,1,87},  {89,1,88},  {90,1,89},
{91,2,41},  {92,1,91},  {93,1,92},  {94,1,93},  {95,1,94},
{96,2,31},  {97,1,96},  {98,1,97},  {99,1,98},  {100,1,99},
{101,2,61}, {102,1,101},  {103,1,102},  {104,1,103},  {105,1,104},
{106,2,66}, {107,1,106},  {108,1,107},  {109,1,108},  {110,1,109},
{111,2,56}, {112,1,111},  {113,1,112},  {114,1,113},  {115,1,114},
{116,2,46}, {117,1,116},  {118,1,117},  {119,1,118},  {120,1,119},
{121,2,81}, {122,1,121},  {123,1,122},  {124,1,123},  {125,1,124},
        {126,2,71}, {127,1,126},  {128,1,127},  {129,1,128},  {130,1,129},
{131,2,76}, {132,1,131},  {133,1,132},  {134,1,133},  {135,1,134}
};
//第五阶段用的变换数据
private static final short[][] bh5=
{
{137,1,136},  {138,1,137},  {139,1,138},  {140,1,139}
};

private static final short[][] QJmoqiu=
{
//五魔方所有面,记录的是面的多边形角点坐标编号,和颜色
{0,0,0,0,0,0,0,0},  //中心点坐标
//12个中心面,五边形
{1,2,3,4,5,1,1,1},
{28,43,58,48,33,2,2,2},
{34,29,44,59,49,3,3,3},
{30,45,60,50,35,4,4,4},
{31,26,41,56,46,5,5,5},
{27,42,57,47,32,6,6,6},
{93,113,118,98,88,7,7,7},
{94,114,119,99,89,8,8,8},
{95,115,120,100,90,9,9,9},
{91,111,116,96,86,10,10,10},
{92,112,117,97,87,11,11,11},
{140,139,138,137,136,12,12,12},
    /*/////////////////////////////*/
    //60个角块面,菱形
{3,17,8,13,0,1,1,1},
{4,18,9,14,0,1,1,1},
{5,19,10,15,0,1,1,1},
{1,20,6,11,0,1,1,1},
{2,16,7,12,0,1,1,1},
{28,13,8,23,0,2,2,2},
{43,38,53,63,0,2,2,2},
{58,68,83,73,0,2,2,2},
{48,78,54,39,0,2,2,2},
{33,24,9,18,0,2,2,2},
{29,14,9,24,0,3,3,3},
{44,39,54,64,0,3,3,3},
{59,69,84,74,0,3,3,3},
{49,79,55,40,0,3,3,3},
{34,25,10,19,0,3,3,3},
{30,15,10,25,0,4,4,4},
{45,40,55,65,0,4,4,4},
{60,70,85,75,0,4,4,4},
{50,80,51,36,0,4,4,4},
{35,21,6,20,0,4,4,4},
{26,11,6,21,0,5,5,5},
{41,36,51,61,0,5,5,5},
{56,66,81,71,0,5,5,5},
{46,76,52,37,0,5,5,5},
{31,22,7,16,0,5,5,5},
{27,12,7,22,0,6,6,6},
{42,37,52,62,0,6,6,6},
{57,67,82,72,0,6,6,6},
{47,77,53,38,0,6,6,6},
{32,23,8,17,0,6,6,6},
{88,63,53,77,0,7,7,7},
{93,72,82,103,0,7,7,7},
{113,108,123,128,0,7,7,7},
{118,133,124,109,0,7,7,7},
{98,104,83,68,0,7,7,7},
{94,73,83,104,0,8,8,8},
{114,109,124,129,0,8,8,8},
{119,134,125,110,0,8,8,8},
{99,105,84,69,0,8,8,8},
{89,64,54,78,0,8,8,8},
{95,74,84,105,0,9,9,9},
{115,110,125,130,0,9,9,9},
{120,135,121,106,0,9,9,9},
{100,101,85,70,0,9,9,9},
{90,65,55,79,0,9,9,9},
{111,106,121,126,0,10,10,10},
{116,131,122,107,0,10,10,10},
{96,102,81,66,0,10,10,10},
{86,61,51,80,0,10,10,10},
{91,75,85,101,0,10,10,10},
{112,107,122,127,0,11,11,11},
{117,132,123,108,0,11,11,11},
{97,103,82,67,0,11,11,11},
{87,62,52,76,0,11,11,11},
{92,71,81,102,0,11,11,11},
{137,127,122,131,0,12,12,12},
{136,126,121,135,0,12,12,12},
{140,130,125,134,0,12,12,12},
{139,129,124,133,0,12,12,12},
{138,128,123,132,0,12,12,12},
    /*////////////////////*/
    //60个棱块面,梯形
{3,13,18,4,0,1,1,1},
{4,14,19,5,0,1,1,1},
{5,15,20,1,0,1,1,1},
{1,11,16,2,0,1,1,1},
{2,12,17,3,0,1,1,1},
{33,18,13,28,0,2,2,2},
{28,23,38,43,0,2,2,2},
{43,63,68,58,0,2,2,2},
{58,73,78,48,0,2,2,2},
{48,39,24,33,0,2,2,2},
{29,24,39,44,0,3,3,3},
{44,64,69,59,0,3,3,3},
{59,74,79,49,0,3,3,3},
{49,40,25,34,0,3,3,3},
{34,19,14,29,0,3,3,3},
{30,25,40,45,0,4,4,4},
{45,65,70,60,0,4,4,4},
{60,75,80,50,0,4,4,4},
{50,36,21,35,0,4,4,4},
{35,20,15,30,0,4,4,4},
{26,21,36,41,0,5,5,5},
{41,61,66,56,0,5,5,5},
{56,71,76,46,0,5,5,5},
{46,37,22,31,0,5,5,5},
{31,16,11,26,0,5,5,5},
{27,22,37,42,0,6,6,6},
{42,62,67,57,0,6,6,6},
{57,72,77,47,0,6,6,6},
{47,38,23,32,0,6,6,6},
{32,17,12,27,0,6,6,6},
{88,77,72,93,0,7,7,7},
{93,103,108,113,0,7,7,7},
{113,128,133,118,0,7,7,7},
{118,109,104,98,0,7,7,7},
{98,68,63,88,0,7,7,7},
{94,104,109,114,0,8,8,8},
{114,129,134,119,0,8,8,8},
{119,110,105,99,0,8,8,8},
{99,69,64,89,0,8,8,8},
{89,78,73,94,0,8,8,8},
{95,105,110,115,0,9,9,9},
{115,130,135,120,0,9,9,9},
{120,106,101,100,0,9,9,9},
{100,70,65,90,0,9,9,9},
{90,79,74,95,0,9,9,9},
{91,101,106,111,0,10,10,10},
{111,126,131,116,0,10,10,10},
{116,107,102,96,0,10,10,10},
{96,66,61,86,0,10,10,10},
{86,80,75,91,0,10,10,10},
{92,102,107,112,0,11,11,11},
{112,127,132,117,0,11,11,11},
{117,108,103,97,0,11,11,11},
{97,67,62,87,0,11,11,11},
{87,76,71,92,0,11,11,11},
{138,132,127,137,0,12,12,12},
{137,131,126,136,0,12,12,12},
{136,135,130,140,0,12,12,12},
{140,134,129,139,0,12,12,12},
{139,133,128,138,0,12,12,12}

};
//12个面的轮廓五边形,记录三维顶点坐标,用来判断鼠标事件落在那个面上
private static final short[][] moqiu1=
{
{0,0,0,0,0,0,0,0},
{6,7,8,9,10,1,1,1},
{8,53,83,54,9,2,2,2},
{54,84,55,10,9,3,3,3},
{55,85,51,6,10,4,4,4},
{51,81,52,7,6,5,5,5},
{52,82,53,8,7,6,6,6},
{82,123,124,83,53,7,7,7},
{83,124,125,84,54,8,8,8},
{84,125,121,85,55,9,9,9},
{85,121,122,81,51,10,10,10},
{81,122,123,82,52,11,11,11},
{122,121,125,124,123,12,12,12}
};
//12个旋转面五边形,转动五魔方面时出现的大五边形面
private static final short[][] moqiu2=
{
{0,0,0,0,0,0,0,0},
        {21,22,23,24,25,1,0,0},
{17,77,104,64,14,2,0,0},
{15,18,78,105,65,3,0,0},
{11,19,79,101,61,4,0,0},
{12,20,80,102,62,5,0,0},
{13,16,76,103,63,6,0,0},
{38,67,132,129,73,7,0,0},
{68,133,130,74,39,8,0,0},
{75,40,69,134,126,9,0,0},
{36,70,135,127,71,10,0,0},
{37,66,131,128,72,11,0,0},
{110,109,108,107,106,12,0,0}
};
private static final int[][] colors=
{          //所用的14种颜色
{0,0,0},
{255,0,0},
{0,140,0},
{0,0,255},
{255,0,255},
{255,200,0},
{0,255,255},
{255,128,255},
{255,255,128},
{255,255,255},
{128,255,128},
{128,128,255},
{255,128,50},
{230,255,240}
};

hubo5563 发表于 2011-4-20 16:44:39

以上都是第一个五魔方模型编程序时用到的数据,都和纸质模型上的编号一致,否则就不对了。

所以设计一个java程序相当不容易。这个还不是复杂的,数据量就这么多,一个帖子字符超了,只好分开用两个帖子发。
以上数据是点和面的编号,不是坐标值,坐标值用程序计算的,如下程序:

private Point3d[] points=new Point3d;   //存放五魔方的各个3维点坐标
double da11,da12,da13,da21,da22,da23,da31,da32,da33;   //五魔方整体转动的变换矩阵
class Point3d     //3D点
{
  double x;
  double y;
   double z;
     
};
  //以下是计算五魔方各个三维点坐标程序
void  makepoint()
{
//该程序计算五魔方各个点的三维坐标
int i;
double c,d,a,sinb,cosb,sina,cosa;
double a11,a12,a21,a22,b1,b2;
//初始化三维点数组
for(i=0;i<141;i++)
{
points=new Point3d();
};
//计算旋转变换矩阵
c=1/Math.sin(Math.PI/5)+Math.cos(Math.PI/5)/Math.sin(Math.PI/5);
c=(c*c-1)/2;
d=(1+Math.sqrt(1+c*4))/2;
a=2/Math.sqrt(d*d+1);
sinb=a/2*Math.cos(Math.PI/5)/Math.sin(Math.PI/5)/Math.sqrt(1-a/2*a/2);
cosb=Math.sqrt(1-sinb*sinb);
sinb=2*sinb*cosb;
cosb=2*cosb*cosb-1;
cosa=Math.cos(2*Math.PI/5);
sina=Math.sin(2*Math.PI/5);
da11=cosb*cosb*cosa+sinb*sinb;
da12=-cosb*sina;
da13=cosb*cosa*sinb-sinb*cosb;
da21=sina*cosb;
da22=cosa;
da23=sina*sinb;
da31=sinb*cosa*cosb-cosb*sinb;
da32=-sinb*sina;
da33=sinb*sinb*cosa+cosb*cosb;

        //五魔方中心点坐标
        points.x=0;
points.y=0;
points.z=0;
        //五魔方上面一个顶点
points.x=a/(2*Math.sin(Math.PI/5)/Math.cos(Math.PI/5));
points.y=-a/2;
points.z=-Math.sqrt(1.0-a/2/Math.sin(Math.PI/5)*a/2/Math.sin(Math.PI/5));

//用坐标旋转变换计算其顶点坐标
       for(i=0;i<4;i++)
{         
  if(bh1==1)
   {
  dbh1(bh1,bh1);
   }
   else
   {
  dbh2(bh1,bh1);
   };
};

//计算棱上两点坐标
points.x=points.x+(points.x-points.x)*3/7;
points.y=points.y+(points.y-points.y)*3/7;
points.z=points.z+(points.z-points.z)*3/7;
points.x=points.x+(points.x-points.x)*4/7;
points.y=points.y+(points.y-points.y)*4/7;
points.z=points.z+(points.z-points.z)*4/7;

//计算第一面上其他棱上的坐标
for(i=0;i<8;i++)
{
  if(bh2==1)
   {
  dbh1(bh2,bh2);
   }
   else
   {
  dbh2(bh2,bh2);
   };
};
        //通过解方程组,计算第一面上的不在棱和顶点上的点,先计算一个
b1=(points.y-points.y)*points.x;
b1=b1-(points.x-points.x)*points.y;
b2=(points.y-points.y)*points.x;
b2=b2-(points.x-points.x)*points.y;
a11=points.y-points.y;
a12=-(points.x-points.x);
a21=points.y-points.y;
a22=-(points.x-points.x);
    points.z=points.z;
    points.x=(b1*a22-b2*a12)/(a11*a22-a21*a12);
    points.y=(a11*b2-a21*b1)/(a11*a22-a21*a12);
      
        //通过坐标变换计算其他四个点坐标
for(i=0;i<4;i++)
{
if(bh3==1)
   {
  dbh1(bh3,bh3);
   }
   else
   {
  dbh2(bh3,bh3);
   };
};
//通过坐标变换计算其它面上的所有三维点坐标
for(i=0;i<115;i++)
{
  if(bh4==1)
   {
  dbh1(bh4,bh4);
   }
else
   {
  dbh2(bh4,bh4);
   };
};
points.x=-points.x;
points.y=-points.y;
points.z=-points.z;
};
//计算三维点的旋转变换,变换1:以Z轴为旋转轴转动72度
void  dbh1(int ii,int jj)
{
points.z=points.z;
points.x=points.x*Math.cos(Math.PI/5*2)+points.y*Math.sin(Math.PI/5*2);
points.y=-points.x*Math.sin(Math.PI/5*2)+points.y*Math.cos(Math.PI/5*2);
};
//计算三维点的旋转变换,变换2:一第二面中心和五魔方中心的连线为轴,旋转72度
void  dbh2(int ii,int jj)
{
points.x=points.x*da11+points.y*da12+points.z*da13;
points.y=points.x*da21+points.y*da22+points.z*da23;
points.z=points.x*da31+points.y*da32+points.z*da33;
};

[ 本帖最后由 hubo5563 于 2011-4-21 15:33 编辑 ]

hubo5563 发表于 2011-4-20 16:47:49

下面是深切五魔方的数据:

//以下是每转动一层一个顺时针72度后,新的魔方各个面颜色的轮换,12个面,共12个轮换的数据
private static final short[][] lh=
{
//1
{1,3,5,7,9,    49,59,19,29,39,    51,11,21,31,41,
2,4,6,8,10,   60,20,30,40,50,
48,58,18,28,38,   52,12,22,32,42},
//2
{11,13,15,17,19,  3,57,67,79,21,    59,69,71,23,5,
12,14,16,18,20,   58,68,80,22,4,
2,56,66,78,30,    60,70,72,24,6},
//3
{21,23,25,27,29,    5,17,77,89,31,   19,79,81,33,7,
22,24,26,28,30,    18,78,90,32,6,
4,16,76,88,40,     20,80,82,34,8},
//4
    {31,33,35,37,39,    7,27,87,99,41,     29,89,91,43,9,
32,34,36,38,40,    28,88,100,42,8,
    6,26,86,98,50,     30,90,92,44,10},
//5
    {41,43,45,47,49,    9,37,97,109,51,    39,99,101,53,1,
42,44,46,48,50,    38,98,110,52,10,
8,36,96,108,60,    40,100,102,54,2},
//6
    {51,53,55,57,59,    1,47,107,69,11,    49,109,61,13,3,
52,54,56,58,60,    48,108,70,12,2,
10,46,106,68,20,   50,110,62,14,4},
//7
    {61,63,65,67,69,    55,105,119,71,13,   107,111,73,15,57,
62,64,66,68,70,    106,120,72,14,56,
54,104,118,80,12,  108,112,74,16,58},
//8
    {71,73,75,77,79,    15,65,117,81,23,   67,119,83,25,17,
72,74,76,78,80,    66,118,82,24,16,
14,64,116,90,22,   68,120,84,26,18},
//9
    {81,83,85,87,89,    25,75,115,91,33,    77,117,93,35,27,
82,84,86,88,90,    76,116,92,34,26,
24,74,114,100,32,  78,118,94,36,28},
//10
    {91,93,95,97,99,    35,85,113,101,43,   87,115,103,45,37,
92,94,96,98,100,   86,114,102,44,36,
34,84,112,110,42,  88,116,104,46,38},
//11
    {101,103,105,107,109,   45,95,111,61,53,   97,113,63,55,47,
102,104,106,108,110,   96,112,62,54,46,
44,94,120,70,52,   98,114,64,56,48},
//12
    {111,113,115,117,119,   63,103,93,83,73,   105,95,85,75,65,
112,114,116,118,120,   104,94,84,74,64,
62,102,92,82,72,   106,96,86,76,66}
};
private static final short[][] bh1=
{
{16,1,13},  {19,1,16},  {22,1,19},  {25,1,22}
};
private static final short[][] bh2=
{
{17,1,14},  {20,1,17},  {23,1,20},  {26,1,23},
    {18,1,15},  {21,1,18},  {24,1,21},  {27,1,24}
};
private static final short[][] bh4=
{
{28,2,26},  {29,1,28},  {30,1,29},  {31,1,30},  {32,1,31},
{33,2,27},   {34,1,33},  {35,1,34},  {36,1,35},  {37,1,36},
{38,2,13},   {39,1,38},  {40,1,39},  {41,1,40},  {42,1,41},
{64,2,14},  {65,1,64},  {66,1,65},  {67,1,66},  {63,1,67},
{59,2,15},   {60,1,59},  {61,1,60},  {62,1,61},  {58,1,62},
{54,2,16},   {55,1,54},  {56,1,55},  {57,1,56},  {53,1,57},
{43,2,28},   {44,1,43},  {45,1,44},  {46,1,45},  {47,1,46},
{48,2,33},   {49,1,48},  {50,1,49},  {51,1,50},  {52,1,51},
{69,2,64},  {70,1,69},  {71,1,70},  {72,1,71},  {68,1,72},
{74,2,59},  {75,1,74},  {76,1,75},  {77,1,76},  {73,1,77},
{79,2,54},  {80,1,79},  {81,1,80},  {82,1,81},  {78,1,82},
{90,2,49},  {91,1,90},  {92,1,91},  {88,1,92},  {89,1,88},
{85,2,44},   {86,1,85},  {87,1,86},  {83,1,87}, { 84,1,83},
        {5,2,1},     {6,1,5},   {2,1,6},    {3,1,2},   {4,1,3},
{10,2,5},    {11,1,10},  {7,1,11},   {8,1,7},   {9,1,8}
};
private static final short[][] QJmoqiu=
{
  {0,0,0,0,0,0,0},
//////////////////////1
{1,17,16,15,1,1,1},
{1,18,17,1,1,1,1},
{1,20,19,18,1,1,1},
{1,21,20,1,1,1,1},
{1,23,22,21,1,1,1},
{1,24,23,1,1,1,1},
{1,26,25,24,1,1,1},
{1,27,26,1,1,1,1},
{1,14,13,27,1,1,1},
{1,15,14,1,1,1,1},
/////////////////////2
{2,30,19,20,2,2,2},
{2,35,30,2,2,2,2},
{2,66,40,35,2,2,2},
{2,61,66,2,2,2,2},
{2,51,56,61,2,2,2},
{2,46,51,2,2,2,2},
{2,36,41,46,2,2,2},
{2,31,36,2,2,2,2},
{2,21,22,31,2,2,2},
{2,20,21,2,2,2,2},
////////////////////3
{3,31,22,23,3,3,3},
{3,36,31,3,3,3,3},
{3,67,41,36,3,3,3},
{3,62,67,3,3,3,3},
{3,52,57,62,3,3,3},
{3,47,52,3,3,3,3},
{3,37,42,47,3,3,3},
{3,32,37,3,3,3,3},
{3,24,25,32,3,3,3},
{3,23,24,3,3,3,3},
///////////////////4
{4,32,25,26,4,4,4},
{4,37,32,4,4,4,4},
{4,63,42,37,4,4,4},
{4,58,63,4,4,4,4},
{4,48,53,58,4,4,4},
{4,43,48,4,4,4,4},
{4,33,38,43,4,4,4},
{4,28,33,4,4,4,4},
{4,27,13,28,4,4,4},
{4,26,27,4,4,4,4},
///////////////////5
{5,28,13,14,5,5,5},
{5,33,28,5,5,5,5},
{5,64,38,33,5,5,5},
{5,59,64,5,5,5,5},
{5,49,54,59,5,5,5},
{5,44,49,5,5,5,5},
{5,34,39,44,5,5,5},
{5,29,34,5,5,5,5},
{5,15,16,29,5,5,5},
{5,14,15,5,5,5,5},
/////////////////6
{6,29,16,17,6,6,6},
{6,34,29,6,6,6,6},
{6,65,39,34,6,6,6},
{6,60,65,6,6,6,6},
{6,50,55,60,6,6,6},
{6,45,50,6,6,6,6},
{6,35,40,45,6,6,6},
{6,30,35,6,6,6,6},
{6,18,19,30,6,6,6},
{6,17,18,6,6,6,6},
/////////////////7
{7,71,55,50,7,7,7},
{7,76,71,7,7,7,7},
{7,92,81,76,7,7,7},
{7,87,92,7,7,7,7},
{7,77,82,87,7,7,7},
{7,72,77,7,7,7,7},
{7,61,56,72,7,7,7},
{7,66,61,7,7,7,7},
{7,45,40,66,7,7,7},
{7,50,45,7,7,7,7},
////////////////8
{8,72,56,51,8,8,8},
{8,77,72,8,8,8,8},
{8,88,82,77,8,8,8},
{8,83,88,8,8,8,8},
{8,73,78,83,8,8,8},
{8,68,73,8,8,8,8},
{8,62,57,68,8,8,8},
{8,67,62,8,8,8,8},
{8,46,41,67,8,8,8},
{8,51,46,8,8,8,8},
///////////////9
{9,68,57,52,9,9,9},
{9,73,68,9,9,9,9},
{9,89,78,73,9,9,9},
{9,84,89,9,9,9,9},
{9,74,79,84,9,9,9},
{9,69,74,9,9,9,9},
{9,58,53,69,9,9,9},
{9,63,58,9,9,9,9},
{9,47,42,63,9,9,9},
{9,52,47,9,9,9,9},
//////////////10
{10,69,53,48,10,10,10},
{10,74,69,10,10,10,10},
{10,90,79,74,10,10,10},
{10,85,90,10,10,10,10},
{10,75,80,85,10,10,10},
{10,70,75,10,10,10,10},
{10,59,54,70,10,10,10},
{10,64,59,10,10,10,10},
{10,43,38,64,10,10,10},
{10,48,43,10,10,10,10},
//////////////11
{11,70,54,49,11,11,11},
{11,75,70,11,11,11,11},
{11,91,80,75,11,11,11},
{11,86,91,11,11,11,11},
{11,76,81,86,11,11,11},
{11,71,76,11,11,11,11},
{11,60,55,71,11,11,11},
{11,65,60,11,11,11,11},
{11,44,39,65,11,11,11},
{11,49,44,11,11,11,11},
///////////////////12
{12,86,81,92,12,12,12},
{12,91,86,12,12,12,12},
{12,85,80,91,12,12,12},
{12,90,85,12,12,12,12},
{12,84,79,90,12,12,12},
{12,89,84,12,12,12,12},
{12,83,78,89,12,12,12},
{12,88,83,12,12,12,12},
{12,87,82,88,12,12,12},
{12,92,87,12,12,12,12}

};
private static final short[][] moqiu1=
{
{0,0,0,0,0,0,0,0},
{13,16,19,22,25,1,0,1},
{19,40,56,41,31,2,0,2},
{22,41,57,42,25,3,0,3},
{25,42,53,38,13,4,0,4},
{13,38,54,39,16,5,0,5},
{16,39,55,40,19,6,0,6},
{40,55,81,82,56,7,0,7},
{56,82,78,57,41,8,0,8},
{57,78,79,53,42,9,0,9},
{53,79,80,54,38,10,0,10},
{54,80,81,55,39,11,0,11},
{79,78,82,81,80,12,0,12}
};
private static final short[][] moqiu2=
{
{0,0,0,0,0,0,0,0},
        {35,36,37,33,34,0,0,0},
{50,77,62,24,17,0,0,0},
{51,73,58,27,20,0,0,0},
{23,52,74,59,15,0,0,0},
{26,48,75,60,18,0,0,0},
{14,49,76,61,21,0,0,0},
{30,65,91,83,46,0,0,0},
{66,92,84,47,31,0,0,0},
{67,88,85,43,32,0,0,0},
{63,89,86,44,28,0,0,0},
{64,90,87,45,29,0,0,0},
{70,69,68,72,71,0,0,0}
};
private static final int[][] colors=
{
{0,0,0},
{255,0,0},
{0,140,0},
{0,0,255},
{255,0,255},
{255,200,0},
{0,255,255},
{255,128,255},
{255,255,128},
{255,255,255},
{128,255,128},
{128,128,255},
{255,128,50},
{230,255,240}
};

对应的魔方:

3
10
99d658
f3a0e2

honglei 发表于 2011-4-20 18:28:06

辛苦了。真的应该感谢胡波先生,不然的话,很多魔方我们都是摸不到的。更别想去复原了。

乌木 发表于 2011-4-20 19:11:03

谁知盘中餐,粒粒皆辛苦。

黄家小子 发表于 2011-4-20 19:39:27

这么多坐标,看的都有点头晕~~~
页: [1] 2 3
查看完整版本: 我的魔方系列仿真程序和演示软件的立体模型(纸质)