Open lgarron opened 13 years ago
I am going to work on adding this feature. Here's how it works in the Cuber project (and now ThreeTwist):
.matrixWorld
property and the current camera to somehow create a "mouse ray". I'm not completely sure how this works but I know that the code for this is in Cuber's projector.js file, so I can reference that.direction
vector, which is the difference between the current ray/plane intersection and the initial intersection point..normal
property). This is the approximate axis of rotation.I am going to work on adding this feature.
You're welcome to try. :-)
However, the code is very old and badly designed. I'm hoping to restructure it at a hackathon some time (the core part was written at a hackathon 5 years ago(!)), but I guess it doesn't hurt to add yet. Thanks for your description of how to handler it. :-)
In principle (and as suggested by three.js demos), it's not hard to capture mouse/touch events and use them to animate moves on the cube. I think the main issue here is handling the in-between animation while someone is moving a layer.
Should include:
touch
branch.