For fun I am trying to make a Rubiks cube. The problem I am having is after the first rotation the origin of the blocks needs to be changed so that when one of the other sides rotates it rotates properly. I have tried move pivot point. lookat, with no success. As you can see rotationY works, but when I go to rotationX after rotating in the Y axis 3 of the block orientations are now different so it rotates wrong. Anyone got any ideas.
Trying to make a Rubiks cubeSoftware: Away3D 4.x |
||
|
||
Fabrice Closier, Administrator
Posted: 22 November 2011 12:13 PM Total Posts: 1265 [ # 1 ] It’s probably a case of http://en.wikipedia.org/wiki/Gimbal_lock You can fix by either multiplying two quaternions or use after each rotation tools.MeshHelper.applyRotations(); |
||
maddog, Sr. Member
Posted: 22 November 2011 03:06 PM Total Posts: 118 [ # 2 ] I got it to work, but for some reason MeshHelper.applyRotations(Mesh(asset)); scales the cubes down by half. I fixed it by do this Mesh(asset).scaleX = 1; but I was wondering why this is happening? |