• 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.

  • 相关阅读:
    Eclipse SVN插件设置
    经典语录-每日积累-05
    Shell基础语法,运算符,循环和判断语句和设置启动参数
    iOS-Jenkins自动化打包集成
    App版本升级相关
    Java-数组和集合简单使用
    Java-内部类简单使用
    Callkit被拒
    Java-Finalize(GC)和类与类和接口之间的关系
    经典语录-每日积累-04
  • 原文地址:https://www.cnblogs.com/coolbear/p/3029073.html
Copyright © 2020-2023  润新知