-
大小: 12KB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-05-17
- 语言: 其他
- 标签: OpenSceneGra osg EagleEye 源代码
资源简介
osg源码EagleEye,实现类似鹰眼图的效果~~~~~~~~~~~~~~~
代码片段和文件信息
#include
#include
#include
#include
#include
#include
#include
#include “player.h“
osg::Camera* createHUDCamera( osg::Viewport* viewport osg::Vec4d ortho2d int mask )
{
osg::Camera* mycamera = new osg::Camera;
mycamera->setReferenceframe( osg::Transform::ABSOLUTE_RF );
mycamera->setViewport( viewport );
mycamera->setProjectionMatrixAsOrtho2D( ortho2d.x() ortho2d.y() ortho2d.z() ortho2d.w() );
mycamera->setRenderOrder( osg::Camera::POST_RENDER );
mycamera->setClearMask( GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT );
mycamera->getOrCreateStateSet()->setMode( GL_LIGHTING osg::StateAttribute::OFF );
mycamera->setInheritanceMask(osg::CullSettings::ALL_VARIABLES & ~osg::CullSettings::CULL_MASK);
mycamera->setCullMask( mask );
return mycamera;
}
int main(int argc char** argv)
{
osg::ref_ptr maingeode = dynamic_cast( osgDB::readNodeFile( “glider.osg“ ) );
maingeode->setNodeMask( 0x01 );
osg::ref_ptr subgeode = dynamic_cast( osgDB::readNodeFile( “simple.osg“ ) );
subgeode->setNodeMask( 0x02 );
osg::ref_ptr eagleeye = createHUDCamera( new osg::Viewport(1010320240) osg::Vec4d(-55-44) 0x02 );
osg::ref_ptr root = new osg::Group;
root->addChild( eagleeye.get() );
for ( int i = 0; i < 3; i++ )
{
osg::ref_ptr pat = new osg::PositionAttitudeTransform;
pat->addChild( maingeode.get() );
pat->addChild( subgeode.get() );
osg::ref_ptryerState> player = new PlayerState( osg::Vec3((float)i 0.0 0.0) );
pat->setEventCallback( new PlayerCallback(player.get() pat.get()) );
eagleeye->addChild( pat.get() );
root->addChild( pat.get() );
}
osgViewer::Viewer viewer;
viewer.setSceneData( root.get() );
viewer.getCamera()->setInheritanceMask(osg::CullSettings::ALL_VARIABLES & ~osg::CullSettings::CULL_MASK);
viewer.getCamera()->setCullMask( 0x01 );
PlayerHandler* playerctrl = new PlayerHandler( 0 );
viewer.addEventHandler( playerctrl );
return viewer.run();
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4690 2008-09-17 17:32 EagleEye\EagleEye\EagleEye.vcproj
文件 1427 2008-09-17 17:33 EagleEye\EagleEye\EagleEye.vcproj.CHINA-043DC02C3.Ray.user
文件 42483 2006-02-02 10:56 EagleEye\EagleEye\glider.osg
文件 2224 2008-09-17 17:32 EagleEye\EagleEye\main.cpp
文件 2940 2008-03-12 12:38 EagleEye\EagleEye\pla
文件 601 2008-03-03 02:48 EagleEye\EagleEye\Simple.osg
文件 890 2008-09-17 17:32 EagleEye\EagleEye.sln
目录 0 2008-09-17 17:33 EagleEye\EagleEye
目录 0 2008-09-17 17:33 EagleEye
----------- --------- ---------- ----- ----
55255 9
相关资源
- OpenSceneGraph基本渲染理论.pdf
- 添加大量倾斜摄影测量模型
- QGIS-OSGeo4W-3.10.0-2-Setup-x86_64
- osgb倾斜摄影数据
- OpenSceneGraph入门教程合集及
- OSG+PCL点云动态显示.rar
- OSGQT结合的VS2017+64位完美运行
- osg3.6.3+osgearth2.10 win10 vs2017 x64
- 基于osg的obb包围盒计算
- OpenSceneGraph 3 Cookbook 源代码
- OSG开源教程
- osg72集视频教程及源码
- OSG 72集视频教程和资料
- 王锐大神osgCookBOOK一书还有对应的源码
- OpenSceneGraph.3.Cookbook.pdf
- Cesium加载OSGB倾斜摄影数据Demo
- osgb转3dtiles工具.zip
- osgearth 可以加载天地图的驱动在xyz基
- OSGB转换3DTile工具箱内带教程
- osg+qt开发源代码
- 最新osg3.6.3+osgearth2.10+qt5.12+vs2017
- osgb转3dtiles工具cesium平台,无限制,支
- OSGB转3DTiles
- SFF-8485 串行GPIOSGPIO总线规范-中文版
- osg坦克模型文件
- OSGi规范r4中文版
- osg房屋模型
- osg三维引擎+QT gui结合,显示三维
- osgearth2.5帮助文档
- osg+mfc 制作
评论
共有 条评论