分享

google earth com api 中IApplicationGE 接口SetCam...

 Jcstone 2012-06-16

HRESULT IApplicationGE::SetCameraParams  ( [in] double  lat, 
  [in] double  lon, 
  [in] double  alt, 
  [in] AltitudeModeGE  altMode, 
  [in] double  range, 
  [in] double  tilt, 
  [in] double  azimuth, 
  [in] double  speed  
 )  

Flies to the specified camera without requiring an ICameraInfoGE instance.

This is provided for performance reasons.

This is an optimized way of setting the camera rather than using SetCamera since it requires a much smaller number of COM calls.

Parameters:
lat  Latitude in degrees. Between -90 and 90.
lon  Longitude in degrees. Between -180 and 180.
alt  Altitude in meters.
altMode  Altitude mode that defines altitude reference origin.
range  Distance between focus point and camera in meters.
tilt  Tilt angle in degrees. Between 0 and 90.
azimuth  Azimuth angle in degrees.
speed  Speed factor to use. Overrides autopilot speed. Value must be greater than 0. If greater than or equal to 5.0, the camera will immediately be set without any transition. This mode is called 'teleport'.
Return values:
S_OK  Successfully set camera.
S_TELEPORTED  Given speed is grater than or equal to 5.0, in which case application's camera was teleported to the destination view.
E_INVALIDARG  invalid argument(s) (e.g. speed is not more than zero).
E_APPLICATION_UNINITIALIZED  Google Earth is not initialized. See IsInitialized.
(other)  Appropriate error code.
See also:
SetCamera, ICameraInfoGE

上面是来自google earth com api 官方文档的资料,http://earth.google.com/comapi/interfaceIApplicationGE.html#9e1c8da5b36e8687fe718f2267224103

Description

Defines a virtual camera that is associated with any element derived from Feature. The LookAt element positions the "camera" in relation to the object that is being viewed. In Google Earth, the view "flies to" this LookAt viewpoint when the user double-clicks an item in the Places panel or double-clicks an icon in the 3D viewer.

Elements Specific to LookAt

<longitude>
Longitude of the point the camera is looking at. Angular distance in degrees, relative to the Prime Meridian. Values west of the Meridian range from ?180 to 0 degrees. Values east of the Meridian range from 0 to 180 degrees.
<latitude>
Latitude of the point the camera is looking at. Degrees north or south of the Equator (0 degrees). Values range from ?90 degrees to 90 degrees.
<altitude>
Distance from the earth's surface, in meters. See <altitudeMode> for how this value is interpreted.
<heading>
Direction (that is, North, South, East, West), in degrees. Default=0 (North). (See diagram below.) Values range from 0 to 360 degrees.
<tilt>
Angle between the direction of the LookAt position and the normal to the surface of the earth. (See diagram below.) Values range from 0 to 90 degrees. Values for <tilt> cannot be negative. A <tilt> value of 0 degrees indicates viewing from directly above. A <tilt> value of 90 degrees indicates viewing along the horizon.
<range> (required)
Distance in meters from the point specified by <longitude>, <latitude>, and <altitude> to the LookAt position. (See diagram below.)
<altitudeMode>
Specifies how the <altitude> specified for the LookAt point is interpreted. Possible values are as follows:
  • clampToGround - (default) Indicates to ignore the <altitude> specification and place the LookAt position on the ground.
  • relativeToGround - Interprets the <altitude> as a value in meters above the ground.
  • absolute - Interprets the <altitude> as a value in meters above sea level.

This diagram illustrates the <range>, <tilt>, and <altitude> elements:

上面的图来自KML文档,解释的比较清楚

http://code.google.com/apis/kml/documentation/kmlreference.html#lookat

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多