Hi Kevin, its me again.. Im trying to make a rubiks cube game based on this. Is there any way to trace when people already solved the rubiks. I know we can keep record of the single movement they've made, however people will have all sort of movements and different types of solution for the rubiks. Is there any way to tell the system that, ok the rubiks is solved now, all the sides have the same color, then do this.
One thing I came out is to check each cube's transform matrix when single rotation animation is done. But the code need to be seriously rewrited. Definitely, there must be better algorithm, but I can't find any useful information right now. Good luck!
we have the cube and today when press the key "l" rotate the left, "r" right, "d" down… and so son but I need to rotate the main axis (the cubes between left ("l") and right ("r").
If it`s no clear I can make an image and show u. BR, Dudu
I`m using this cube but I don`t know how to add event when I click in the cubes. I have added InteractiveScene3DEvent, and MouseEvent to my cube object but I can`t get when the cube is clicked.
What do you mean by setting interactive material to the cube?
I using as I downloaded and put to listen the events to the cube. I tried InteractiveScene3DEvemt, MouseEvent and when I click in the cube, nothing happens.
You need to set event handler for each child “cube”: for(var i : uint = 0;i < 26; i++) { rubiksCube.getChildByName("cube" + (i + 1)).addEventListener(InteractiveScene3DEvent.OBJECT_CLICK, clickHandler); }
I tried this and didn't work. I remove the stage listener and not happened. I'm using this version of papervision: Papervision3D 2.1 rev920 (August 11th, 2009) Could I send my code for you or could you send me a code with the click event working in this cube?
what to change in the code if I want to rotate the middle pieces also.
Hi Kevin, its me again.. Im trying to make a rubiks cube game based on this. Is there any way to trace when people already solved the rubiks. I know we can keep record of the single movement they've made, however people will have all sort of movements and different types of solution for the rubiks. Is there any way to tell the system that, ok the rubiks is solved now, all the sides have the same color, then do this.
Your help is greatly appreciated man.
Thanks
One thing I came out is to check each cube's transform matrix when single rotation animation is done. But the code need to be seriously rewrited. Definitely, there must be better algorithm, but I can't find any useful information right now.
Good luck!
Let me try to explain:
we have the cube and today when press the key "l" rotate the left, "r" right, "d" down… and so son but I need to rotate the main axis (the cubes between left ("l") and right ("r").
If it`s no clear I can make an image and show u.
BR,
Dudu
It’s impossible to rotate the “middle cubes” in a real rubik’s cube, but if you just want it that way, you must develop it by yourself.
Hello,
Do you know how can I modify to rotate the cube in the middle?
Because today the axis in the middle it`s not rotating.
BR,
Dudu
what do you mean “cube in the middle”?
Hello,
I`m using this cube but I don`t know how to add event when I click in the cubes.
I have added InteractiveScene3DEvent, and MouseEvent to my cube object but I can`t get when the cube is clicked.
Can you help me?
BR,
Dudu
Did you set interactive material to the cube?
What do you mean by setting interactive material to the cube?
I using as I downloaded and put to listen the events to the cube. I tried InteractiveScene3DEvemt, MouseEvent and when I click in the cube, nothing happens.
Can you help me please?
BR,
Dudu
Yes, I set
frontMat.interactive = true;
But doens't work also.
You need to set event handler for each child “cube”:
for(var i : uint = 0;i < 26; i++) {
rubiksCube.getChildByName("cube" + (i + 1)).addEventListener(InteractiveScene3DEvent.OBJECT_CLICK, clickHandler);
}
Hello Kevin,
I tried this and didn't work. I remove the stage listener and not happened.
I'm using this version of papervision: Papervision3D 2.1 rev920 (August 11th, 2009)
Could I send my code for you or could you send me a code with the click event working in this cube?
Thanks you very much,
Dudu
check out this post:
http://kevincao.com/2009/09/rubikscubes-interactive-material-issue/
Thank you very much Kevin….
I was missing var cube : DisplayObject3D = event.target as DisplayObject3D;
BR,
Dudu
Hello,
How to add event when I click on a cube face in this sample?
I tried but no success. Anyone can help me please?
BR,
Dudu