News for hackers. Stuff that matters.
Re:Show HN: Rubik's cube variants in different shapes and si... by app4soft on Tuesday October 02, 2018 @04:27PM (#18125417)
Sadly, it not work for me.

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/

Re:Show HN: Rubik's cube variants in different shapes and si... by aditya_r_m on Sunday October 07, 2018 @05:45AM (#18159735)
I passed the code through Google closure compiler.

Now it should work on your browser, assuming that it supports HTML5 canvas API.

Re:Show HN: Rubik's cube variants in different shapes and si... by aditya_r_m on Tuesday October 02, 2018 @11:39PM (#18127466)
I'll look into it, probably will need to run Google closure compiler on the JavaScript code.
Re:Show HN: Rubik's cube variants in different shapes and si... by RandomGuyDTB on Thursday October 04, 2018 @09:10AM (#18139535)
Pretty cool but it'd be nice to have buttons to turn the cube rather than gestures - or at least an option in the settings for it. Love it either way.
Re:Show HN: Rubik's cube variants in different shapes and si... by aditya_r_m on Friday October 05, 2018 @03:44AM (#18146411)
Will add this feature in the TODO list :) thanks!
Re:Show HN: Rubik's cube variants in different shapes and si... by glandium on Tuesday October 02, 2018 @02:48AM (#18119317)
How do you rotate around the vertical axis on the diamond variants?
Re:Show HN: Rubik's cube variants in different shapes and si... by aditya_r_m on Tuesday October 02, 2018 @04:54AM (#18119848)
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)
Re:Show HN: Rubik's cube variants in different shapes and si... by newuser6969 on Tuesday October 02, 2018 @02:27AM (#18119239)
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
Re:Show HN: Rubik's cube variants in different shapes and si... by aditya_r_m on Sunday October 07, 2018 @05:43AM (#18159728)
Improved it, thank you!

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.

Re:Show HN: Rubik's cube variants in different shapes and si... by aditya_r_m on Tuesday October 02, 2018 @04:51AM (#18119835)
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.