osgearth设置视点

From

韶华百世

的新浪博客

注意,在earthManip->setViewpoint()之前,要先v->setCameraManipulator(earthManip);

在使用osgEarth中的EarthManipulator,通过setViewpoint设置视点:
1.osg::ref_ptr<osgEarth::Util::EarthManipulator> manip = new osgEarth::Util::EarthManipulator;
2.manip->setViewpoint( osgEarth::Util::Viewpoint( 108.0f, 34.0f, 10000.0f, 0.0f, -45.0f, 1e7 ) );

osg::ref_ptr<osgEarth::Util::EarthManipulator> earthManip = new osgEarth::Util::EarthManipulator;

            v->setCameraManipulator(earthManip);//必须在setViewpoint之前

osgEarth::Viewpoint vp( "", 107.85, 32.35, 0.0, -2.50, -90.0, 1.5e7 );

earthManip->setViewpoint( vp, 0 );

 

* Constructs a new viewpoint.
*
* @param name
* Name of this viewpoint.
*
* @param focal_point 焦点
* The location at which the camera points. Express this is either
* cartesian coordinates (for a "flat-earth" model) or in lat/long
* degrees for a round-earth model.
*
* @param heading_deg  水平方位角
* Heading (in clockwise degrees) of the camera relative to the
* tangent plane of the focal point.
*
* @param pitch_deg 垂直俯仰角
* Pitch (in degrees) of the camera relative to the tangent plane
* of the focal point.
*
* @param range 焦距
* Straight-line distance from the camera to the focal point.
*
* @param srs (optional)
* Spatial reference defining the focal point.

转载于:https://www.cnblogs.com/coolbear/archive/2013/04/18/3029073.html

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值