I did it, and I think you will need to look at the css matrix transformations available to you to get exactly what you want.
Unfortunately, this is not as easy as turning and then moving the origin. It happens that the cube rotates around this edge, but then if you move the transformation point, it will apply the previous transformation to the cube using this new origin.
What else is needed to translate the position of the cube. You cannot move it using pure rotation. Matrices should solve all this, I think (I donโt know, thereโs an awful lot about them, Iโm afraid)
You can see the modified jsfiddle that I created, where the cube is rotated and translated. The transfer point is the center, so it looks like the cube is โrollingโ. here is the critical additional code:
... //left zAngle -= 90; xPos -= 50; //rotate and translate the position of the cube $('#cube')[0].style["WebkitTransform"]="translateX("+xPos+"px) rotateZ("+zAngle+"deg)"; ...
js Script here: http://jsfiddle.net/DigitalBiscuits/evYYm/20/
Hope this helps you!
source share