
osg
千杯不醉-sen
予人玫瑰,手有余香!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
MFC+OSG之UI COM组件开发
前几天研究了WPF开发UI COM组件,今天结合OSG给大家演示一下如何开发OSG的UI COM组件。我这里的OSG环境是之前搭建好的,环境没有搭建好可以参考如下网站:[OSG+VS2015+Win10配置](https://blog.youkuaiyun.com/wangshubo1989/article/details/51591802%20OSG+VS2015+Win10%E9%85%8D%...原创 2018-08-20 10:51:50 · 1299 阅读 · 0 评论 -
OSG之禁用按下Escape关闭视图
我们在操作视图的时候,按下Escape视图被动关闭,操作起来着实不方便。如何才能禁用Escape关闭视图呢?查看源码发现如下: /** Set the key event that the viewer checks on each frame to see if the viewer's done flag should be set to * signal...原创 2018-11-27 14:44:54 · 1140 阅读 · 0 评论 -
OSGEarth之坐标转换
// 屏幕坐标转世界坐标osg::Vec3d Global::ScreenToWorld(const osg::Vec3d screen){ osg::Camera* camera = _global->Viewer->getCamera(); osg::Matrix VPW = camera->getViewMatrix() * camera->getProjec...原创 2018-11-27 13:48:27 · 5231 阅读 · 0 评论 -
计算任意模型中心经纬度的方法
废话不多说,先上核心代码: osg::NodePathList nodePaths = node->getParentalNodePaths(); if ( nodePaths.empty() ) return 0; osg::NodePath path = nodePaths[0]; osg::Matrixd localToWorld = osg::com...原创 2018-11-20 10:06:17 · 1575 阅读 · 1 评论 -
OSG&OSGEarth编译心得
编译OSG下载数据源http://www.openscenegraph.org/downloads/stable_releases/下载最全的(含full)第三方库https://download.osgvisual.org/官网下载源码http://www.openscenegraph.org/index.php/download-section/stable-releases...原创 2018-11-20 09:45:21 · 6414 阅读 · 3 评论 -
EarthManipulator的缩放问题
EarthManipulator默认的操作是向里滚动,地球远了,向外滚动,地球进了。我不太习惯这种操作,我个人认为向里滚动,地球近了,向外滚动,地球远了。查找了一下EarthManipulator的源码,在初始化的时候简单修改一下。_scroll_sens ( 1.0 )将1.0改为-1.0即可。_scroll_sens ...原创 2018-11-21 19:01:50 · 1334 阅读 · 1 评论 -
OSGEarth关闭光照的方法
方法一:earth文件配置关闭 <options> <lighting>false</lighting> <terrain> <lighting>false</lighting> </terrain> </options>方原创 2018-11-20 17:43:37 · 2470 阅读 · 0 评论 -
EarthManipulator实现定位
EarthManipulator* em = new EarthManipulator(); viewer.setCameraManipulator( em );方法一 em->setTetherNode( app.geo ); osgEarth::Viewpoint vp; vp.setNode( app.geo ); vp.headi...原创 2018-11-20 16:21:35 · 2708 阅读 · 1 评论 -
OSGEarth添加渲染器
Earth的渲染机制和OSG的不一样,具体区别我也说不出一二来,直接上代码。 _global->Caster->setLight( _global->Viewer->getLight() ); _global->Caster->getShadowCastingGroup()->addChild( _global->MapNode->get...原创 2018-11-20 15:55:10 · 3552 阅读 · 1 评论 -
OSGEarth添加天空盒
在Earth的基础上添加天空盒,使得Earth更加好看。 _global-&gt;SkyNode-&gt;setDateTime(osgEarth::DateTime(d.year(), d.month(), d.day(), 5.0)); if ( _global-&gt;MapNode-&gt;getNumParents() &gt; 0 ) { osgEarth::insert...原创 2018-11-20 15:48:05 · 4802 阅读 · 9 评论 -
OSG&OSGEarth中文处理方法
std::string StringToUTF8(const std::string& str){ std::wstring ansiStr; { int nLen = ::MultiByteToWideChar(CP_ACP, 0, str.c_str(), str.length(), NULL, 0); WCHAR* buffer = new WCHAR[nLen + ...原创 2018-11-28 11:13:27 · 952 阅读 · 2 评论