Rotation Problem

Im trying to create a rubik cube but i keep having problems with rotations, when is a single face rotation everythinks looks fine but when i combine 2 rotations it get weird

Okay i put my code on glitch here is the links:

Code - Glitch :・゚✧
Live - https://sprinkle-pinto-scorpio.glitch.me

One Rotation 90 degrees on the left face - Rotation on the x axis

image

image

After second rotation on the back face with 45 degrees - rotation on the Z axis

image

image

I also found out if i do the X axis rotation it appears that i have to do Y axis rotation on some cubes and Z axis rotation on another for all to work good but that solution doesnt work.

I created a group consisted of the frame of the cube and the faces.
Loads everything then if it is Last, adds the group to the scene.
The this.cube is an array of groups.

image

Thanks for your help in advance.

Notice that it’s more likely to get feedback if you demonstrate the issue with a live example, https://jsfiddle.net/f2Lommf5/.

TBH, the screenshots are not really helpful to understand what’s going wrong.

Thanks for your reply, i can send you the code i cant put it on fiddle because i have a folder with models (GLTF) created from blender, and i don’t know how to upload the code with the models to fiddle.

Link to download the project: https://we.tl/t-sO8mZoetPY

Thanks again!

You can upload models when creating a live example with https://glitch.com/.

Okay i put my code on glitch here is the links:

Code - Glitch :・゚✧
Live - https://sprinkle-pinto-scorpio.glitch.me

1 Like