Cool demo! One thing you could do to improve this is use quaternions to handle rotation of the cube. There are some great articles on implementing quaternions out there if you search for them. For example, I noticed when you turn a cube "upside down", the dragging to the left or right (with ctrl pressed) rotates the cube the wrong way. Quaternions are a great way to solve this issue
yes, Quaternions.. thank you! Will do.. :)
I was expecting exactly this answer to the third problem I mentioned in that medium article.
I've been thinking of studying them for some time now.
Note that Quaternions didn't fix the issue by themselves.
I had to change the interpretation of cursor movements to use axis-angle rotation based orientation.
The fix could be deployed with or without Quaternions.
I think you may be mistaking them for a different type of puzzle with diamond shape & similar look.
As far as I know,there are two possible variants of similar looking Octahedron shaped puzzles:
1) Face turning octahedron (the ones I've currently defined in the project)
2) Axis turning octahedron (on which you can twist around axis)
10 comments
[ 3.0 ms ] story [ 36.4 ms ] threadNote that Quaternions didn't fix the issue by themselves. I had to change the interpretation of cursor movements to use axis-angle rotation based orientation.
The fix could be deployed with or without Quaternions.
After click on "play" button nothing happen, look on screenshot[0]
Browser: Pale Moon 28.1.0[1]
[0] http://i.imgur.com/0GYEa9D.png
[1] http://linux.palemoon.org/download/mainline/
Now it should work on your browser, assuming that it supports HTML5 canvas API.