Esempio n. 1
0
 public MapTransform()
 {
     _circumference  = 0.0;
     _rotationMatrix = new RotationMatrix();
     _rotationMatrix.MakeIdentity();
     _originX      = 0;
     _originY      = 0;
     _mapHeight    = 0;
     _mapWidth     = 0;
     _canvasHeight = 0;
     _canvasWidth  = 0;
 }
Esempio n. 2
0
        /// <summary>
        /// Sets up a rotation of the map from (0 Lat, 0 Lon, true north orientation) to the desired
        /// location and orientation. To rotate to a point on the globe with true north orientation
        /// the passed parameters would be SetRotation(0,lat,lon)
        /// </summary>
        /// <param name="xRotateDegrees">Orienation angle in degrees (from true north)</param>
        /// <param name="yRotateDegrees">Latitude angle in degrees</param>
        /// <param name="zRotateDegrees">Longitude angle in degrees</param>
        public void SetRotation(double xRotateDegrees, double yRotateDegrees, double zRotateDegrees)
        {
            RotationMatrix xMatrix = new RotationMatrix();
            RotationMatrix yMatrix = new RotationMatrix();
            RotationMatrix zMatrix = new RotationMatrix();

            xMatrix.MakeRotateX(Utilities.ToRadians(xRotateDegrees));
            // we need to reverse the orientation rotation
            xMatrix.matrix = Matrix3.Transpose(xMatrix.matrix);

            yMatrix.MakeRotateY(Utilities.ToRadians(yRotateDegrees));
            zMatrix.MakeRotateZ(Utilities.ToRadians(zRotateDegrees));
            _rotationMatrix.matrix = (xMatrix.matrix * yMatrix.matrix * zMatrix.matrix);
        }