【php精品源码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。
网学会员整理了php精品源码-osgearth论坛问题集锦 - 其它资料的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
怎么获取 osgearth 支持的影像数据下载到本地?刚接触 osgearth,想请教大家:怎么获取 osgearth 支持的影像数据到本地,包括一些层级不高的不需要很精确的全球影像和层级较高的较清晰的部分城市的影像(像 Google earth那样有地名的),以.earth 文件中读取本地数据?谢谢大家!使用 osgEarth 的缓存插件,设置缓存路径就可以了这个方法知道,但不知道从哪可以获取到符合要求(类似 Google earth 有位置标签)的影像数据。
可以用谷歌地图下载器下载,然后使用 GDAL 插件加载可以用 GDAL 插件加载吗?好像不行哎,你试验成功过嚒?得修改 GDAL 插件 图片是没有坐标的,所以得人为制定坐标包围盒 这个看着有些抽象osgearth 在局域网上的配置问题由于个人电脑不能上外网,所以只能在单位内部网络上自行加载地形和影像数据。
在服务器端加载了地形和影像,客户端用.earth 文件配置来读取,提示 can not initialize TileSource forlayer west.tifltmap namequotearthquot typequotgeocentricquot versionquot2quotgt ltimage driverquotgdalquot namequotworld-tiffquot gt lturlgthttp://192.168.150/world.tiflt/urlgt lt/imagegt ltelevation driverquotgdalquot namequotDE-tiffquot gt lturlgthttp://192.168.150/srtm.tiflt/urlgt lt/elevation gt ltoptions lightingquotfalsequot/gtlt/mapgt我在服务器端没有编译 gdal。
客户端有编译好的 gdal。
请各位指点一下,谢谢!建议看一下 gdal 插件是否支持联网读取 tif,大的 tif 不建议联网读,tms 和 vpb 的 ive 使用联网读取比好好如何获取读入的栅格图片的坐标范围通过 gdalOption 读入 一块栅格图片 , 请问如何获得 该栅格图片的坐标范围osg::Image createImage const TileKeyamp key ProgressCallback progress 创建瓦片的时候,你可以通过 TileKey 获取图片的层级及 tile_x,tile_x,通过这些信息可以推算出图片的坐标范围OSGEARTH 如何获取当前缩放的级别 如题!有什么简单实用方法,我用 profile 里面的方法得到 tilekey,再由 tilekey 来获取,感觉绕了一个弯子。
我是这么在运动过程中调整模型姿态的当对一个物体进行先平移再旋转的操作时 目标是将物体沿 x 轴正向平移 10 个单位 再将物体自身绕 z 轴顺时针旋转 30 度 但是在实际实施变换的过程中后 却得不到正确的结果.如图所示 图中水平垂直分别为 x y 坐标轴 z 坐标与纸面垂直.上一行是用户原来希望得到的结果 而下一行则是实际实施了变换之后得到的结果. 在 osgearth 中,无论使用以下哪种都会发生这种现象。
//scale-gtpostMultosg::Matrix::rotateosg:egreesToRadians-90.0 0 1 0//locator-gtgetLocator-gtsetOrientationosg::Vec3d-90 0 0 看到一篇 osg 论文,使用在每次变换前先将物体平移至世界坐标系的原点 实施变换之后再将物体进行反平移的方法,实验证明是好用的,代码如下://获取场景节点 将其转换为 MatrixTransform 类型const osg::Matrix m_matrix scale-gtgetMatrix //获得变换物体表面顶点矩阵const osg::BoundingSphere m_box scale-gtgetBound //获得变换物体的包围盒 从而获得物体的中心osg::Matrix preMat osg::Matrix::translate-m_box.center osg::Matrix proMat osg::Matrix::translatem_box.center osg::Matrix matrix1 m_matrix preMat //将物体中心平移至世界坐标的原点osg::Matrix matrix2 matrix1 osg::Matrix::rotateosg:egreesToRadians-90.0 0 1 0//进行变换级联 采用先缩放后旋转再平移的顺序osg::Matrix matrix matrix2 proMat //变换后再将物体移回scale-gtsetMatrixmatrix //将结果矩阵重新设回物体不知道是否有更好的方法,盼高手指点一般是遵循 SRT遵循 SRTScale/Rotate/Translate是在模型刚添加进场景的时候,在实时仿真的时候,一般不会知道模型移动到哪里了,这样移动之后再旋转,就会出现之前说的问题。
虽然问题可以解决,但是我不确定这种解决办法是不是最好的或最有效的,所以想请教各位大牛!我是这么在 osgearth 里头画线的线的画法和 osg 里头一样,可参看 osggeometry.cpp,但是点的坐标需要经过转换,实践证明是可行的,应该也可以用到其它几何体上。
新手上路,欢迎大牛们拍砖。
这部分放在 main()或者 InitSceneGraph void 中osg::ref_ptrltosg::Geodegt geode new osg::GeodemRoot-gtaddChildgeode//测试画线osg::Vec3d startline-155.150257 63.390041 220230osg::Vec3d endline-165.150257 63.390041 0createLinestartline endlinevoid OSGEarthEngine::createLineosg::Vec3d startline osg::Vec3d endline const SpatialReference mapSRS mapNode-gtgetMapSRS // create Geometry object to store all the vertices and lines primitive. osg::ref_ptrltosg::Geometrygt linesGeom new osg::Geometry // this time well preallocate the vertex array to the size we // need and then simple set them as array elements 2 points // makes 1 line segments. osg::Vec3d startWorld osg::Vec3d endWorld osg::ref_ptrltosg::Vec3dArraygt vertices new osg::Vec3dArray2 mapNode-gtgetMap-gttoWorldPoint GeoPointmapSRSstartline startWorld mapNode-gtgetMap-gttoWorldPoint GeoPointmapSRSendline endWorld vertices0 startWorld vertices1 endWorld // pass the created vertex array to the points geometry object. linesGeom-gtsetVertexArrayvertices // set the colors as before plus using the above osg::ref_ptrltosg::Vec4Arraygt colors new osg::Vec4Array colors-gtpush_backosg::Vec41.0f1.0f0.0f1.0f linesGeom-gtsetColorArraycolors linesGeom-gtsetColorBindingosg::Geometry::BIND_OVERALL // set the normal in the same way color. osg::ref_ptrltosg::Vec3Arraygt normals new osg::Vec3Array normals-gtpush_backosg::Vec30.0f-1.0f0.0f linesGeom-gtsetNormalArraynormals linesGeom-gtsetNormalBindingosg::Geometry::BIND_OVERALL // This time we simply use primitive and hardwire the number of coords to use // since we know up front linesGeom-gtaddPrimitiveSetnew osg:rawArraysosg:rimitiveSet:INES02 // add the points geometry to the geode. geode-gtaddDrawablelinesGeom请教在 earth 文件中使用 ive 数据显示精度不足的问题ltmap namequotTargetquot typequotgeocentricquot versionquot2quotgt ltoptionsgt ltlightinggtfalselt/lightinggt ltcache typequotfilesystemquotgt ltpathgt.osgearth_cachelt/pathgt lt/cachegt lt/optionsgt ltimage namequotTIFquot driverquotvpbquotgt lturlgt.earthearth.ivelt/urlgt lt/imagegtlt/mapgtive 是自己用 8 片 tif 处理的,但是调入 earth 文件之后,绘制效率比直接调入 tif 快但显示精度就明显差了不少,比直接看 ive 地形就差得更远,不知道是为什么好像最精细的层级都没有显示出来,求各位大神指教建议你参照一下
上一篇:
虚拟主机应用及moodle搭建
下一篇:
谈谈初学者怎样突破英语音标