![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
osgEarth
VectorM4a1
这个作者很懒,什么都没留下…
展开
-
OsgEarth节点跟随
osgEarth::Viewpoint vp;//设置视点参数,focalPoint()函数返回的是一个点_point,然后调用set()函数进行设置,第一个参数是空间参考参数,第二个是经度,第三个是纬度,第四个是Z值//最后一个参数用来描述Z是怎么解释的,有两种,ALTMODE_ABSOLUTE是绝对高程,从椭球体(?)开始算的,ALTMODE_RELATIVE是相对高程,从地形的标高以上开始算的,就是基准点在那个经纬度对应的点的最高处vp.focalPoint()->set(mapNode-原创 2022-01-14 11:02:50 · 625 阅读 · 0 评论 -
osgEarth根据MatrixTransform获取经纬度、欧拉值
//根据matrixTransform获取经纬度osg::Vec3d getModelPosition(osg::ref_ptr<osg::MatrixTransform> m_pModelNode){ osg::Vec3d posXYZ = osg::Vec3d(); osg::Vec3d currentPosition = osg::Vec3d(); if (m_pModelNode) { osg::Matrix mat = m_pModelNode->getMatri原创 2022-01-06 15:58:08 · 1733 阅读 · 0 评论 -
osgEarth 局部坐标系用法
//节点osg::ref_ptr<osg::Node> nd = new osg::Node;//全局geometryosg::ref_ptr<osg::Geometry> geometry = new osg::Geometry;//矩阵相关osg::Matrix _BasePointMat;osg::Matrixd _BasePointInverseMat;osg::ref_ptr<osg::MatrixTransform> matTrans1 =原创 2022-01-06 10:01:36 · 660 阅读 · 0 评论 -
osgEarth::Util::Controls::LabelControl 显示汉字
//记得加上头文件#include <Windows.h>//转换为中文字符进行显示void gb2312ToUnicode(const string& src, wstring& result){int n = MultiByteToWideChar(CP_ACP, 0, src.c_str(), -1, NULL, 0);result.resize(n);::MultiByteToWideChar(CP_ACP, 0, src.c_str(), -1, (LPW原创 2021-11-30 17:58:27 · 456 阅读 · 0 评论 -
执行Install的时候出错。
VS2015编译完osg osgEarth后,执行Install的时候出错。用管理员的方式打开VS2015 即可原创 2021-08-23 15:12:45 · 218 阅读 · 0 评论 -
osgEarth坐标转换
```cpp// 屏幕坐标转世界坐标osg::Vec3d ScreenToWorld(const osg::Vec3d screen){ osg::Camera* camera = _global->Viewer->getCamera(); osg::Matrix VPW = camera->getViewMatrix() * camera->getProjectionMatrix() * camera->getViewport()->computeWindo.原创 2021-08-09 14:09:40 · 600 阅读 · 0 评论 -
高程生成TMS切片
高程生成TMS切片osgearth_package out.earth --tms --max-level 12 --out d:/tms out.earth的内容<map name="xinjiangdem" version="2"> <heightfield name = "xindem" driver = "gdal"> <url>D:/dev/gctest/gc2.tif</url> <ti原创 2021-08-05 11:07:25 · 405 阅读 · 0 评论 -
osgEarth 生成并加载mbtiles
osgEarth 生成并加载mbtiles生成mbtiles命令:osgearth_conv --in driver gdal --in url 1.tif --out driver mbtiles --out filename world.db --out format png注意:末尾处若用jpg格式会有奇怪的问题,png正常加载mbtiles<image name="影像图" driver="mbtiles" base="true" group="影像图"> <file原创 2021-08-05 10:21:37 · 1190 阅读 · 3 评论