flash - How to fix rotations in a Rubik's Cube? -


I am trying to create a Rubik cube in the flu & amp; Papevision and I'm really stuck here. I am at that point where I can rotate any plane of Cubes once, but after that ... it is a mess because all local coordinate systems are messy.

I do not know where to go from here, what can anyone do but give some advice? I'm not looking for 'read about change matrix', I know I need (and I'm doing this), but I'm not really sure what to look. My idea is, after every rotation, I should recover each coordinate system of each cube, but I do not know how.

(use cursorkeys + A and d)

hate to say it But, the matrix is ​​simple:

The code has been well commented too.

One more thing that comes to mind, if the matrix is ​​overkill, then blending / reparting the display object 3D examples on the fly.

Say you have something basic like this:

  High Cubes: DisplayObject3D = New DisplayObject3D (); Cubes.name = 'cubes'; (Var i: int = 0; i  

These groups will only help in certain circumstances, but the point to keep in mind is that you can say name and group DO3D

that you click Do and drag a small cube:

  1. Whether there is a position on current active faces (collection of 3x3 box)
  2. Based on that you know what the group of 3 is,
  3. subtracting the position of the current mouse on the basis of the previous one, you know which direction the direction rotates.

HTH, George


Comments