Sie sind nicht angemeldet.

1

Sonntag, 18. Juli 2010, 08:04

Rotation of a circle (navigation plugin)

I am working on a navigation plugin, like cameracontrol or more relevamt: the navigation used on 360cities.
So far I am making progress, but I have a problem with the rotation of a circle, on which a wedge displaying the current fovis attached.

Here is a code snippet from a function called from krpano.onviewchanged:

private function wedgeHandler() : void {
var heading : Number = krpano.get("view.hlookat");

........ cutting out the code calculating the position of the wedge showing fov.

// ------------------------------------------------------------------------
// Calculate the rotation angle: subtract current heading from last_hlookat.
// ------------------------------------------------------------------------
var degrees = heading - last_hlookat;

var upperNavigatorWedgeMatrix : Matrix = upperNavigatorWedge.transform.matrix.clone();
var mat : Matrix = upperNavigatorWedgeMatrix.clone();
MatrixTransformer.rotateAroundExternalPoint(mat, centerOfCircle.x, centerOfCircle.y, degrees);
upperNavigatorWedge.transform.matrix = mat;
}

This works, however the rotation will eventually move the circle in relation to the movieclip below with some up/down/left/right buttons. Rotating along the horisontal make the circle move slightly down and left.
I know this is a known issue. But I do not know how to correct it. Some assistance is appreciated.