|
发表于 2013-4-10 14:41:30
|
显示全部楼层
- if ( getSRS() && getSRS()->isGeographic() )
- {
- conf.set("lat", _focal_point.y());
- conf.set("long", _focal_point.x());
- conf.set("height", _focal_point.z());
- }
- else
- {
- conf.set("x", _focal_point.x());
- conf.set("y", _focal_point.y());
- conf.set("z", _focal_point.z());
- }
复制代码 viewpoint.cpp中,从这段代码看z值应该是球体地形的地面高度,平面地形的z值。
而在EarthMnipulator.cpp中有一段(如下),用三角形的斜边乘以正弦,貌似在计算垂直高度,求得目标点和起始点的垂直高度差,注释好像是在求相机运动的加速度,看起来range应该是(eye-center).length(),即camera到point的向量的模长。- // calculate an acceleration factor based on the Z differential
- double h0 = _start_viewpoint.getRange() * sin( osg::DegreesToRadians(-_start_viewpoint.getPitch()) );
- double h1 = vp.getRange() * sin( osg::DegreesToRadians( -vp.getPitch() ) );
- double dh = (h1 - h0);
复制代码 |
|