魔方吧·中文魔方俱乐部

标题: [讨论]尝试写的一个魔方的模拟器程序,希望大家给点意见 [打印本页]

作者: sliant    时间: 2005-3-25 21:29:48     标题: [讨论]尝试写的一个魔方的模拟器程序,希望大家给点意见

程序的测试版演示、源代码下载在 http://sliant.vicp.net/programming

这个程序最开始是用 java 3d 写的,图像效果很好,但是需要用户安装 java + java3d + directX ,很不方便。

目前正在使用纯 java 来写,用户只需要安装 java 。

已经完成的功能有:自定义n阶(n>=1);自定义贴图;鼠标点击转动魔方层;鼠标拖动旋转视角 准备完成的功能:鼠标拖动转动;

希望大家能给出意见: 1、写这个程序有必要吗? 2、要装 java 可以忍受吗? 3、程序运行的速度可以接受吗? 4、什么样的功能比较重要,需要实现,如:随机打乱魔方,转动纪录,步法演示等?


作者: sliant    时间: 2005-3-25 22:11:07

我使用的是 j2sdk-1_4_2_07-windows-i586-p.exe 编译开发的,更低版本的java也许不能运行
作者: cube_master    时间: 2005-3-25 22:30:09

以下是引用sliant在2005-3-25 21:29:48的发言:

程序的测试版演示、源代码下载在 http://sliant.vicp.net/programming

希望大家能给出意见: 1、写这个程序有必要吗? 2、要装 java 可以忍受吗? 3、程序运行的速度可以接受吗? 4、什么样的功能比较重要,需要实现,如:随机打乱魔方,转动纪录,步法演示等?

答: 1、有必要!毕竟是国内第一 2、可以忍受,因为论坛现在使用的也需要安装 3、希望能改进 4、试用后再补充

总之一句:支持 支持 支持 支持 强烈支持


作者: cube_master    时间: 2005-3-25 22:36:39     标题: [讨论]尝试写的一个魔方的模拟器程序,希望大家给点意见

希望下一版能支持“已转动步骤”和“需转动步骤”
作者: 大烟头    时间: 2005-3-26 08:40:23

以下是引用sliant在2005-3-25 21:29:48的发言:

希望大家能给出意见: 1、写这个程序有必要吗? 2、要装 java 可以忍受吗? 3、程序运行的速度可以接受吗? 4、什么样的功能比较重要,需要实现,如:随机打乱魔方,转动纪录,步法演示等?

1、很有必要。

2、要我装10次我都可忍受。

3、接受。

4、期待能做个魔方步法演示的贴助手。

晚天看了老兄的作品,真的很好用[em17]。

我对java很外行,只有旁边呐喊助威的份了,目前国外也只有3至5阶魔方的java步法演示的贴助手,热切期待有人能做出五魔方、金字塔魔方等的java步法演示的贴助手。

[em23][em23][em23]

[em24][em24][em24]
作者: cube_master    时间: 2005-3-26 21:06:14

三阶步法演示--国际通用表示法(SupersetENG)

SupersetENG
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
表层旋转
U
U'
U2
D
D'
D2
L
L'
L2
R
R'
R2
F
F'
F2
B
B'
B2
双层旋转
TU
TU'
TU2
TD
TD'
TD2
TL
TL'
TL2
TR
TR'
TR2
TF
TF'
TF2
TB
TB'
TB2
中层旋转
MU
MU'
MU2
MD
MD'
MD2
ML
ML'
ML2
MR
MR'
MR2
MF
MF'
MF2
MB
MB'
MB2
夹层旋转
SU
SU'
SU2
SD
SD'
SD2
SL
SL'
SL2
SR
SR'
SR2
SF
SF'
SF2
SB
SB'
SB2
整体旋转
CU
CU'
CU2
CD
CD'
CD2
CL
CL'
CL2
CR
CR'
CR2
CF
CF'
CF2
CB
CB'
CB2

[此贴子已经被作者于2005-3-26 23:08:09编辑过]


作者: cube_master    时间: 2005-3-26 21:07:51

三阶步法演示--国际通用表示法(HarrisENG)

HarrisENG
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
表层旋转
U
U'
U2
D
D'
D2
L
L'
L2
R
R'
R2
F
F'
F2
B
B'
B2
双层旋转
u
u'
u2
d
d'
d2
l
l'
l2
r
r'
r2
f
f'
f2
b
b'
b2
中层旋转
E'
E
E2
E
E'
E2
M
M'
M2
M'
M
M2
S
S'
S2
S'
S
S2
夹层旋转
e'
e
e2
e
e'
e2
m
m'
m2
m'
m
m2
s
s'
s2
s'
s
s2
整体旋转
y
y'
y2
y'
y
y2
x'
x
x2
x
x'
x2
z
z'
z2
z'
z
z2

[此贴子已经被作者于2005-3-26 21:09:00编辑过]


作者: cube_master    时间: 2005-3-26 21:10:15

四阶步法演示--国际通用表示法(SupersetENG)

SupersetENG
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
第一层旋转
U
U'
U2
D
D'
D2
L
L'
L2
R
R'
R2
F
F'
F2
B
B'
B2
一二层旋转
TU
TU'
TU2
TD
TD'
TD2
TL
TL'
TL2
TR
TR'
TR2
TF
TF'
TF2
TB
TB'
TB2
第二层旋转
MU
MU'
MU2
MD
MD'
MD2
ML
ML'
ML2
MR
MR'
MR2
MF
MF'
MF2
MB
MB'
MB2
一四层旋转
SU
SU'
SU2
SD
SD'
SD2
SL
SL'
SL2
SR
SR'
SR2
SF
SF'
SF2
SB
SB'
SB2
整体旋转
CU
CU'
CU2
CD
CD'
CD2
CL
CL'
CL2
CR
CR'
CR2
CF
CF'
CF2
CB
CB'
CB2


作者: cube_master    时间: 2005-3-26 21:11:20

四阶步法演示--国际通用表示法(RandelshoferGER)

RandelshoferGER
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
第一层旋转
O
O-
O2
U
U-
U2
L
L-
L2
R
R-
R2
V
V-
V2
H
H-
H2
第二层旋转
MO
MO-
MO2
MU
MU-
MU2
ML
ML-
ML2
MR
MR-
MR2
MV
MV-
MV2
MH
MH-
MH2
整体旋转
BO
BO-
BO2
BU
BU-
BU2
BL
BL-
BL2
BR
BR-
BR2
BV
BV-
BV2
BH
BH-
BH2


作者: cube_master    时间: 2005-3-26 21:12:09

五阶步法演示--国际通用表示法(SupersetENG)

SupersetENG
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
第一层旋转
U
U'
U2
D
D'
D2
L
L'
L2
R
R'
R2
F
F'
F2
B
B'
B2
一二层旋转
TU
TU'
TU2
TD
TD'
TD2
TL
TL'
TL2
TR
TR'
TR2
TF
TF'
TF2
TB
TB'
TB2
第二层旋转
M1U
M1U'
M1U2
M1D
M1D'
M1D2
M1L
M1L'
M1L2
M1R
M1R'
M1R2
M1F
M1F'
M1F2
M1B
M1B'
M1B2
第三层旋转
MU
MU'
MU2
MD
MD'
MD2
ML
ML'
ML2
MR
MR'
MR2
MF
MF'
MF2
MB
MB'
MB2
一五层旋转
SU
SU'
SU2
SD
SD'
SD2
SL
SL'
SL2
SR
SR'
SR2
SF
SF'
SF2
SB
SB'
SB2
整体旋转
CU
CU'
CU2
CD
CD'
CD2
CL
CL'
CL2
CR
CR'
CR2
CF
CF'
CF2
CB
CB'
CB2

作者: cube_master    时间: 2005-3-26 23:11:09

五阶步法演示--国际通用表示法(MorrisENG)

MorrisENG
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
顺90
逆90
180
第一层旋转
U
U'
U2
D
D'
D2
L
L'
L2
R
R'
R2
F
F'
F2
B
B'
B2
一二层旋转
Uu
Uu'
Uu2
Dd
Dd'
Dd2
Ll
Ll
Ll2
Rr
Rr'
Rr2
Ff
Ff'
Ff2
Bb
Bb'
Bb2
第二层旋转
u
u'
u2
d
d'
d2
l
l'
l2
rr
r'
r2
ff
f'
f2
b
b'
b2
整体旋转
Y
Y'
Y2
Y'
Y
Y2
X'
X
X2
X
X'
X2
Z
Z'
Z2
Z'
Z
Z2


作者: sliant    时间: 2005-3-28 12:40:35     标题: 回复:(sliant)[讨论]尝试写的一个魔方的模拟器程序...

已经支持脚本了。支持的记法还不全面,不过可以自己添加、定义,上面有讲怎么做。

花了不少时间,短期内可能再抽不出时间来完善这个程序了。

感谢cube_master和大烟头给的资料,感谢老猫给我的例程,感谢roundy给的3d原理。

祝大家顺心如意,我要睡觉去了!bye


作者: rubikmaster    时间: 2006-8-16 19:47:14     标题: 回复:(sliant)[讨论]尝试写的一个魔方的模拟器程序...

我与你兴趣相同。我已经用纯java写了一个虚拟魔方(可解2-8阶)和一个虚拟五魔方<br>(可自动解,两种解法),均采用三维模拟。可自动解的五魔方为首创。3阶魔方平均<br>可在68步之内解得,6阶魔方平均可在530步之内解得。五魔方平均可在206步之内解<br>得。可惜我无法将之汉化,因为我没有汉化环境。欢迎测试,欢迎指教,连接如下<br><br>http://www.geocities.com/hua_jz/index.html<br><br>测试版中有些功能被锁住了,但是2阶和3阶初级解法完全工作。正版须买执照。须<br>安装java虚拟环境J2SE JRE1.4或高级。可预览界面。
作者: ggglgq    时间: 2006-9-12 08:42:51

 

    Megaminx 的 JAVA 软件的面世,使大家在网上直接浏览含 Megaminx 的网页成为可能。
本人谨在这里向 rubikmaster 先生表示感谢和支持!

    (可自动解的 JAVA 五魔方) 可能是您 首创。但是(可自动解的 其他语言 五魔方)
好象早已存在多年了。 如果我说错了,那或许说明 您 很早以前就开发了 五魔方 软件。

    如果 rubikmaster 先生感觉对于 汉化 Megaminx 的 JAVA 软件有困难,本人愿意帮助
您汉化,只是本人 English 水平很烂,需要您提供一份准确的 (English -> 中文) 对照
翻译好的文本,以便本人汉化。      附:文本格式如下:

File 文件
Edit 编辑
Help 帮助
save 保存
exit 退出
about 关于
English 英文
Chinese 中文
computer 计算机
These are sheep.  这是些羊。

等等。

    对于长句子,也要 对应 长句整体 翻译 (注:不要 逐词 翻译,必须 整句翻译)。
 


作者: ggglgq    时间: 2006-9-12 08:44:02

 

    rubikmaster 先生可以通过以下两种途径进行汉化:

    1.直接发给我 minxseqviewer.jar ,本人直接汉化其内部 *.class 文件;(临时方案)
(此方案汉化工作烦琐,而且仅能汉化一个版本)

    2.压缩发给我 Megaminx 软件中所有 *.Java 及 相关文件,本人汉化源文件,然后发给
您进行修改编译 以及 升级维护;(终极方案)(此方案工作量小,软件可以终身升级维护)


    rubikmaster 先生可以通过  Email:   ggglgq@sina.com.cn  与本人联系。


作者: rubikmaster    时间: 2006-9-18 12:40:22     标题: 回复:(ggglgq rubikmas...

先谢谢你乐意帮这个忙,但我不建议将我的软件直接汉化,我更倾向于将我的说明文件翻译成中文,以方便大家使用,有兴趣的魔友不妨试一试。现将英文说明粘贴如下:
<h3>Introduction</h3>
<p>
Most people would think that Megaminx is harder to solve than Rubik's Cube because it has more
faces and pieces? This software shows you that Megaminx is indeed easier to solve than Rubik's Cube. Why is it so?
Becuase Megaminx got more faces. When you are fixing the first few layers, you got plenty of free layers which give you lots
of freedom to adjust the position of your target pieces. You can fix much of the Megaminx without even learning a single
formula. But this is not the case for Rubik's Cube, once the first layer is fixed, the only free layer is the opposite layer.
The real difficulty of solving Megaminx is the last layer. Fortunately, there is a simple elegant method to solve the last
layer. This method can be used to solve Rubik's Cube as well. The two methods embedded in Megaminx Solver are designed for 12
colored Megaminx, but it can be easily modified to solve 6 colored Megaminx in which parity problem may arise. This is a
little challenge left for the readers.


<h3>Introduction</h3>
<p>
Most people would think that Megaminx is harder to solve than Rubik's Cube because it has more
faces and pieces? This software shows you that Megaminx is indeed easier to solve than Rubik's Cube. Why is it so?
Becuase Megaminx got more faces. When you are fixing the first few layers, you got plenty of free layers which give you lots
of freedom to adjust the position of your target pieces. You can fix much of the Megaminx without even learning a single
formula. But this is not the case for Rubik's Cube, once the first layer is fixed, the only free layer is the opposite layer.
The real difficulty of solving Megaminx is the last layer. Fortunately, there is a simple elegant method to solve the last
layer. This method can be used to solve Rubik's Cube as well. The two methods embedded in Megaminx Solver are designed for 12
colored Megaminx, but it can be easily modified to solve 6 colored Megaminx in which parity problem may arise. This is a
little challenge left for the readers.

<p>
To view the applet, your browser must support JRE1.4 (Java Runtime Environment) or higher. You can
<a href="http://java.sun.com/javase/downloads/index.jsp">download J2SE JRE</a> from Sun.
After the download, you need to install JRE on your system by following the installation instruction.

<p>
<B>Main features of Megaminx Solver </B>

<uL>
<LI>A twist can be triggered by a mouse click or a mouse drag. Clicking a center cube with the left mouse button will trigger
 an anti-clockwise turn of 72 degree, while clicking a center cube with the right mouse button will trigger a clockwise turn of 72 degree.
 Dragging a non-center cube to its adjacent non-center cubes will also trigger a turn of 72 degree along the dragging direction only
 if the mouse moves on the same face.
<LI>The virtual dodecahedron can be viewed from any angle by dragging the mouse on center cubes or on the background area even when a twist is in action.
 It is a true 3D simulation.
<LI>Each face has been labelled with a letter (N, A, B, C, D, E, S, F, G, H, I, J). Face labels can be turned on/off.
<LI>Standard definition of a move/twist using face labels is given and has been incorporated in the solver.
<LI>Two algorithms are embedded, one solves the puzzle in about 266 moves and the other solves the puzzle in about 206 moves.
 The solution sequence will be shown in the sequence executor. Both algorithms are human understandable.
<LI>7 navigation buttons are provided to allow a user to navigate the solution sequence back and forth. A track counter will display
 the number of the current move and the length of the solution sequence.
<LI>While a solution sequence is being navigated by "Forward" or "Back" buttons, the next move will be shown in a diagram which can
 be easily understood.
<LI>While a solution sequence is being navigated, cubes that are being targeted in current operation will be highlighted,
 which helps the user to understand how highlighted cubes are fixed.
<LI>While a solution sequence is being navigated, a user can hide all cubes that are irrelevant to the current step which
 will be fixed in later steps and therefore can be freely disturbed, only cubes that have been fixed or are being
 fixed in current step are shown in full colors.
<LI>While a solution sequence is being navigated, a step indicator will show what is the current step and the message window
 will explain how this is done.
<LI>Center colors are configurable. It allows a user to paint the virtual MEgaminx so that it matches the colors of a physical
 Megaminx (with 12 colors). The solver can instruct the user to solve his/her Megaminx puzzle step by step.
 It provides an opportunity for a user to solve his/her own Megaminx without even learning any algorithm or method.
<LI>The sequence executor allows a user to enter his/her sequence and get it executed. It provides an opportunity for a user
 to develop his/her own formula. It also provides an opportunity for users to exchange their formulae through the sequence executor.
<LI>The solver also provides functions such as scrambling the virtual MEgaminx using randomly generated sequence, restoring the Megaminx to
 solved position instantly, adjusting puzzle size and adjusting rotation speed.
</UL>


<p>
<h3>Terminology</h3>

A <i>single turn</i> means a face / layer being twisted by 72 degree around its center. Each face has been given a label
(N, S, A, B, C, D, E, F, G, H, I, where N means north and S menas south). Face labels are fixed, however face colors
can be changed through painting.
A <i>move</i> or <i>twist</i> can be represented using face characters and turn symbols (', 1, 2, -1, -2)
according to the following rules:

<ul type="disc">
 <li>A single face character represents a single turn clockwise of that face.
 <li>A single face character followed by 2 represents a double turn clockwise of that face.
 <li>A single face character followed by ' or -1 represents a single turn anti-clockwise of that face.
 <li>A single face character followed by '' or -2 represents a double turn anti-clockwise of that face.
</ul>

We adopt terminology suggested by Professor Kurt Endl. We think the dodecahedron as a globe and refer corners and edges according to their location relative to north pole and south pole. In Megaminx Solver, the center labelled with "N"
will be treated as North Pole, and the center labelled with "S" will be treated as "South Pole". Centers labelled with "A", "B",
"C", "D", "E" are located at northern hemisphere and centers lablled with "F", "G', "H", "I", "J" are located at southern hemisphere. The following diagrams illusitrate the classification of corners and edges.

<h3>How to play Megaminx Solver</h3>

A move or twist can be triggered by a mouse click or a mouse drag.
<ul>
 <li>Clicking a center cube with the LEFT mouse button will trigger an ANTI-CLOCKWISE turn.
 <li>Clicking a center cube with the RIGHT mouse button will trigger a CLOCKWISE turn.
 <li>Dragging a non-center cube to its adjacent non-center cubes will also trigger a turn long the dragging
  direction if the mouse moves on the same face.
</ul>

The megaminx can be viewed from different angles by rotating the whole megaminx. To rotate the whole megaminx,
just drag on any center cube or drag the mouse on the background area (the area that is
not covered by the megaminx).

<p>
Some useful buttons under Configure:

<ul>
 <li>Cube Size -- adjust the size of the megaminx
 <li>Rotating Speed -- adjust rotating speed
 <li>Face Label -- turn the face label on or off
 <li>Hide/Show -- hide or show cubes that are irrelavant to the current step. It is only effective when an animated solution
  is being reviewed. When "hide" is active, only cubes that are fixed or targeted will be shown, cubes that are
  irrelavant to the current step and hence will be dealt with in a later step are hidden (shown with gray color).
</ul>

<p>
Some useful buttons under Tools:
<ul>
 <li>lay -- play the megaminx by clicking or dragging the mouse
 <li>aint -- paint the megaminx with colors to match the colors on your megaminx.
 <li>Scramble -- scramble the megaminx using randomly generated sequences
 <li>Restore -- restore the megaminx to its solved positition (each face has a solid color).
 <li>Solve -- solve the megaminx using selected method, animated solution can then be viewed with the
  navigation buttons, targeted cubies will be hightlighted, the next move will be shown at the
  bottom left corner of the megaminx panel.
</ul>

To execute a sequence, first type in your sequence in the text field below the cube panel, then
press the "Enter" key. The sequence entered must conform the convention stated below.

<p>

<h3>How to paint Virtual Megaminx</h3>

Select 'Paint' under 'Tools' to enter painting model. It is a good practice to start painting on a solved megaminx.
The first thing you need to do is to adjust center colors.
Right click a color button below the tree panel to open the color chooser. Select a color that matches
the corresponding center color on your megaminx. Once you are happy with all center colors, then you can start to
paint edges and corners. Left click a color button to select the color as the active painting color, a small pentagon
filled with that color will be drawn on the bottom left corner of the megaminx panel. Click a face on any edge cube
or corner cube to paint that face with the active color. Note that you cannot paint a center face using this method.
The center color can only be changed by right clicking the corresponding color button. Once you finish painting all
cubes, you can select 'Solve' under 'Tools' to ask the simulator to solve it. If the color configuration is invalid,
it will return to painting model immediately. Double check each face, and make sure all colors match the corresponding
colors on your megaminx. To exit the painting model at any time, select "Play", "Scramble", "Restore" or "Solve" under "Tools".
<h3>Screen shots of Virtual Megaminx</h3>

<h3>Jeff's method</h3>

This is the simplest method as far as I know. It solves the megaminx in 266 moves on average.
The Megaminx is solved according to the following order:

<OL>
 <LI>Fix south pole edges
 <LI>Fix four south pole corners
 <LI>Fix four southern equatorial edges
 <LI>Fix the last south pole corner
 <LI>Fix the last southern equatorial edge
 <LI>Fix southern equatorial corners
 <LI>Fix middle equatorial edges
 <LI>Fix four pairs of northern equatorial corners and edges, leaving the fifth pair as key holes
 <LI>Fix north pole edges and the last northern equatorial edge
 <LI>lace north pole corners and the last northern equatorial corner (ignore orientations)
 <LI>Fix orientations of north pole corners and the last northern equatorial corner
</OL>

<h3>Hua's method</h3>
Hua's method improves Jeff's method by fixing south pole corners and southern equatorial edges in pairs and
fixing southern equatorial corners and middle equatorial edges in triples and also
fixing northern equatorial corners and edges in pairs. It solves the megaminx in 206 moves on average.
According to Hua's method, the Megaminx is solved in the following order:

<OL>
 <LI>Fix south pole edges
 <LI>Fix south pole corners and southern equatorial edges in pairs
 <LI>Fix southern equatorial corners and middle equatorial edges in triples
 <LI>Fix four pairs of northern equatorial corners and edges
 <LI>Fix north pole edges and the last northern equatorial edge
 <LI>lace north pole corners and the last northern equatorial corner (ignore orientations)
 <LI>Fix orientations of north pole corners and the last northern equatorial corner
</OL>

<h3>Contact </h3>

Megaminx Solver was developed by Jiuzhao Hua. All rights reserved. All queries should be directed to hua_jz@hotmail.com.

<p>
Last updated on 1 August 2006.


作者: 魔五    时间: 2006-11-27 20:13:17

支持
作者: mlyfe0508    时间: 2008-7-2 23:00:39

?????看不懂啊~~




欢迎光临 魔方吧·中文魔方俱乐部 (http://bbs.mf8-china.com/) Powered by Discuz! X2