cubing / AnimCubeJS

▶️ Play around with a Rubik's Cube simulator.
https://animcubejs.cubing.net/animcubejs.html
MIT License
25 stars 8 forks source link

Another way of showing hidden faces (backView = "side-by-side") #39

Open tarasovladislav opened 2 weeks ago

tarasovladislav commented 2 weeks ago

Hi

How do you think, would it be possible to make something similar what cubingjs has (backView = "side-by-side"). So you have 2nd cube which actually is same cube but from other angle and still can rotate the cube

image

https://codepen.io/cubing/pen/vYyKBMd

mfeather1 commented 1 week ago

try this backview.zip

mfeather1 commented 1 week ago

backview.zip Updated so Y movements done to the second cube work as expected (as opposed to rotating in opposite direction). Also reduced the space between the cubes which minimizes the possibility of rotation not working properly (both cubes rotate opposite of Y movement if drag starts from the gap).

mfeather1 commented 1 week ago

This seems to have eliminated the gap problem altogether (add the if statement in mousedown).

mousedownId = e.target.parentNode.id;
if (mousedownId != 'c1' && mousedownId != 'c2')
  mousedownId = 'c1';