Poptávám vyhotovení kódu pro plugin 3D Viewer (https://imagej.net/3D_Viewer) v ImageJ nebo pro alternativní plugin pro 3D zobrazeni v ImageJ (např. Interactive Stack Rotation, https://imagej.net/Interactive_Stack_Rotation) zajišťující rotaci dle hodnot x, y, z (úhlů) dodávaných přes BlueTooth.
Oba pluginy mají v sobě zabudované funkce rotace. Rotace probíhá pomocí myši (stisk a tažení) anebo klávesami.
Je tedy potřeba 1) zajistit příjem hodnot pro rotaci, 2) zajistit (úpravou) rotaci objektu
Příklad zabudované funkce pro rotaci:
/**
* Rotates the view around the center of view by the specified
* angle around the given axis (of the image plate).
* @param axis The axis of rotation (in image plate coordinate system)
* @param angle The angle (in rad) around the given axis
*/
public void rotate(Vector3d axis, double angle) {
Vector3d axisVW = new Vector3d();
getAxisVworld(axis, axisVW);
aa.set(axisVW, angle);
tmp.set(aa);
// first apply the old transform
rotationTG.getTransform(rotationXform);
// rotate
rotationXform.mul(tmp, rotationXform);
rotationTG.setTransform(rotationXform);
transformChanged(BehaviorCallback.ROTATE, rotationXform);
}