merpig / RubiksProgram

Program that simulates a rubiks cube
15 stars 8 forks source link

Initial cube orientation seems wrong-ish #12

Closed andrewlow closed 2 years ago

andrewlow commented 2 years ago

http://www.rubiksplace.com/move-notations/ - lists the defacto standard cube notation

F (front): the face facing the solver.
B (back): the back face.
R (right): the right face.
L (left): the left face.
U (up): the upper face.
D (down): the face opposite to the upper face.

image

However - when we consider this project's display of a cube and the rotations it seems the F (front) face is the bottom one (visually) image

Things seem even more "wrong" when we look at U image

L and R are similarly 'wrong' - or at least seem to be to me.

I'm guilty of not yet going digging into the code to figure out if this is easy to fix - but wanted to see if you had any interest in addressing this or not.

For my needs - I'm looking at forking and changing some of the patterns to capture "my way" of solving the cube for demonstration purposes. However, it would be handy to have the on screen cube render match the notations.

It's a pretty cool project, thanks for sharing it.

merpig commented 2 years ago

I just need to change the camera view when starting the application on the y-axis by +90 degrees. My notation is based on

On my megaminx program I have the moves colored to match their face and I am planning on putting that in the rubiks program as well so that should also add more clarity.

On the topic of making updates the icons for the forward and back buttons will be fixed soon too.

andrewlow commented 2 years ago

Cool - I was splunking in the code to try to figure out where (and how) three.js setup for the camera happened.

A 90deg change would help a lot - also - but this is my preference , an additional 45deg in a different axis would cause the cube to appear more like the classic sitting on table look.

If you point me at the right place in the code I will experiment - but I can keep looking around / learning three.js. Thanks for responding.

merpig commented 2 years ago

I rotated the cube by 90 degrees so it more closely resembles the orientation one might expect on load. Move colors have been added. The appearance of the undo and redo buttons have been fixed. On smaller view ports the undo and redo onClicks have some slight unintended effects on the menu (visually but nothing breaking), I'll get around to fixing that eventually and there's a few places where I need to clear move history when changing menu state.

merpig commented 2 years ago

The code for handling the camera view can be found in App.js in the src directory. Lines 958-960.

merpig commented 2 years ago

Hmm somehow pushing these changes broke all my touch events, will have those fixed soon too.