Domanda

Well, I'm developing a application using Java3D, which can solve Rubik's cube showing the user step-step solution.
I did my Algorithm part perfectly, and now the issue is with 3D cube,
Till now, i've created 27 cubes as in real one.
The problem is that, inorder to rotate a face clockwise or anti-clockwise, I should add those individual cubes to a group which in turn can be used to rotate the face anti-clockwise or clockwise direction as i said, but indeed the nodes in edges have to be in multiple groups, so that they can rotate either on X axis or Y axis or else we can take two axis of rotation.
so, my question now is, how to add a node to multiple groups ?
Or if it is not possible, Well then there must be a way to construct a Rubiks cube and to rotate its faces, How to do that!

Can you help me with this!!

È stato utile?

Soluzione

Adding the cubes to BranchGroups and dynamically updating them or managing multiple groups sounds complicated.

Perhaps consider keeping the cubes independent. Create three transforms: one to rotate clockwise/counter-clockwise 90 degrees about each of the three axes. To rotate a face, apply the same transform to each of the cubes in that face -- since they are all rotating about the same axis anyways.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top