RotationDrag (with nice picture :-))

Hello,



perhaps someone can give me a hint…

I have programmed a drag listener. Dragging of spatials works perfect. Now I want to implement a drag rotation listener.







The molecule is on my screen. My camera is somewhere in space having quaternion cq. The spatial, a molecule, is somewhere in space having quaternion mq. When I drag, I get a vector v which tells me the change of the spatial translation (as if I would drag the molecule for translation change !!). Now I want to use v to calculate the new mq lets call it nmq. I think it must work somehow in this way.



Transform vector v to camera system.

Transform the new vector to the molecule system.

Apply it somehow.

Set new quaternion for molecule.



If someone can give me a hint, I would be grateful.



Thanks a lot.



Regards,

Equi

This kind of handling is used in jMP, look at http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3-gde/jme3-core/src/com/jme3/gde/core/scene/controller/AbstractCameraController.java?r=6281