Announcement

Collapse
No announcement yet.

Some Questions about the WorldCamera

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Some Questions about the WorldCamera

    Hi all:
    I am a novice on the camera control in WorldWind. After reading the code in SetPosition,I have some questions about it.Hope someone can help me to understand it.
    the following is snippet copied from WorldCamera.cs
    Code:
    SetPosition(double lat, double lon, double heading, double _altitude, double tilt, double bank)
    {
       //.............omit...........	
       this._targetOrientation = 
       Quaternion4d.EulerToQuaternion(MathEngine.DegreesToRadians(lon),//Yaw
    			        MathEngine.DegreesToRadians(lat),//Pitch
    			        MathEngine.DegreesToRadians(heading));
    
        Point3d v = Quaternion4d.QuaternionToEuler(this._targetOrientation);
    
       this._targetLatitude.Radians = v.Y;
       this._targetLongitude.Radians = v.X;
       this._targetHeading.Radians = v.Z;
    
    }
    (1)according to my knowledge , the longitude is defined by the angle of rotation around Z axis of earth. but it seems that the longitude is used as the angle for Yaw rotation, which is the rotation around Y axis of earth.
    why does it work?
    (2)it seems that the function above transforms the eular angles,i.e,lon,lat and heading ,to a quaterion,and then converts the quaterion back to the eular angles.why do we need to do that?what is the difference between this two kinds of eular angle?

    thanks !
Working...
X