osg::Camera example
#ifdef _WIN32
#include <Windows.h>
#endif // _WIN32
#include<iostream> #include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgViewer/CompositeViewer> #include <osgDB/ReadFile> #include <osg/Geode>
#include <osg/Node>
#include <osg/Geometry>
#include <osg/GraphicsContext>
#include <osg/ShapeDrawable>
#include <osg/Material>
#include <osg/Image>
#include <osg/Texture2D>
#include <osg/TexEnv>
#include <osg/TexGen>
#include <osg/NodeVisitor>
#include <osg/MatrixTransform>
#include <osg/PositionAttitudeTransform>
#include <osg/AnimationPath>
#include <osg/Matrixd>
#include <osg/PagedLOD>
#include <osg/Camera> #include <osgGA/TrackballManipulator>
#include <osgGA/GUIEventHandler>
#include <osgGA/CameraManipulator>
#include <osgGA/StandardManipulator>
#include <osgGA/OrbitManipulator>
#include <osgGA/TrackballManipulator> #include <osgUtil/IntersectionVisitor>
#include <osgUtil/LineSegmentIntersector> int main()
{
osg::ref_ptr<osgViewer::Viewer> viewer1 = new osgViewer::Viewer;
osg::ref_ptr<osg::Group> group1 = new osg::Group;
osg::ref_ptr<osg::Camera> camera1 = new osg::Camera; osg::ref_ptr<osg::Node> node1 = osgDB::readNodeFile("D:\\参考手册\\BIM\\osg\\build20190628.osgb"); camera1->addChild(node1);
camera1->setViewport(, , , );
camera1->setClearColor(osg::Vec4(0.0,0.0,0.0,0.0)); group1->addChild(node1.get());
group1->addChild(camera1.get()); viewer1->setSceneData(group1.get());
viewer1->setUpViewInWindow(, , , , ); viewer1->run();
}
osg::Camera example的更多相关文章
- osg::Camera 参数修改
#ifdef _WIN32 #include <Windows.h> #endif // _WIN32 #include<iostream> #include <osgV ...
- Learning OSG programing---Multi Camera in Multi window 在多窗口中创建多相机
这个例子演示了在多个窗口中创建多个相机,函数的代码如下: void multiWindowMultipleCameras(osgViewer::Viewer& viewer,bool mult ...
- Learning OSG programing---Multi Camera in one window 在单窗口中创建多相机
在学习OSG提供的例子osgCamera中,由于例子很长,涉及很多细节,考虑将其分解为几个小例子.本文介绍实现在一个窗口中添加多个相机的功能. 此函数接受一个Viewer引用类型参数,设置图形上下文的 ...
- [OSG]OpenSceneGraph FAQ 以及OSG资源
1.地球背面的一个点,计算它在屏幕上的坐标,能得到吗? 不是被挡住了吗? 答:计算一个空间点的屏幕坐标,使用osgAPEx::GetScreenPosition函数.当空间点处于相机视空间内(不管它是 ...
- [OSG]OSG例子程序简介
1.example_osganimate一)演示了路径动画的使用(AnimationPath.AnimationPathCallback),路径动画回调可以作用在Camera.CameraView.M ...
- osg设置相机参数,包括初始位置
严重注意!!!以下设置必须在viewer.realize();之后,否则不起作用!!!! 设置相机的位置,可以通过CameraManipulator(一般是osgGA::TrackballManipu ...
- OSG中的HUD
OSG中的HUD 所谓HUD节点,说白了就是无论三维场景中的内容怎么改变,它都能在屏幕上固定位置显示的节点. 实现要点: 关闭光照,不受场景光照影响,所有内容以同一亮度显示 关闭深度测试 调整渲染顺序 ...
- osg实例介绍
osg实例介绍 转自:http://blog.csdn.net/yungis/article/list/1 [原]osgmotionblur例子 该例子演示了运动模糊的效果.一下内容是转自网上的:原理 ...
- OSG中的示例程序简介
OSG中的示例程序简介 转自:http://www.cnblogs.com/indif/archive/2011/05/13/2045136.html 1.example_osganimate一)演示 ...
随机推荐
- Notes for <<Thinking In Java>>
String Thus, when you create a toString( ) method, if the operations are simple ones that the comp ...
- Java8新特性之重复注解(repeating annotations)
一.什么是重复注解 允许在同一申明类型(类,属性,或方法)的多次使用同一个注解 二.一个简单的例子java 8之前也有重复使用注解的解决方案,但可读性不是很好,比如下面的代码: 复制代码代码如下: p ...
- js依赖mui.css生成图片验证码
js依赖mui.css生成图片验证码 相关css和js引入路径 https://cdnjs.cloudflare.com/ajax/libs/mui/3.7.1/css/mui.css https:/ ...
- Spring Security 流程
首先创建4个类 流程大致如下: 1.容器启动 加载系统资源与权限列表(HashMap) MyInvocationSecurityMetadataSourceService中的loadResourceD ...
- Selenium常用API的使用java语言之14-多窗口切换
在页面操作过程中有时候点击某个链接会弹出新的窗口, 这时就需要主机切换到新打开的窗口上进行操作.WebDriver提供了switchTo().window()方法可以实现在不同的窗口之间切换. 以百度 ...
- SQL:分区拾忆
1.文件组与文件 数据库属性——可以先添加多个文件组(抽象分割) 单个文件组可以有多文件(物理上的分割),可以添加文件然后指定文件组 例如: 2.分区函数 语法: CREATE PARTITION F ...
- h5css样式
兼容性前缀: 谷歌:webkit 火狐:moz ie:ms 欧鹏:o选择器: 属性选择器: * = 包含 {href * = 'www'} ^ = 以什么开头 $ = 以什么结尾 伪类选择器: 第一个 ...
- boost::swap
boost::swap是对标准库里的std::swap的增强和泛化,为交换两个变量的值提供便捷的方法. 为了使用需包含头文件: #include <boost/swap.hpp> 原理 c ...
- P3588 [POI2015]PUS
好题 思路:线段树优化建图+拓扑DP or 差分约束(都差不多): 提交:3次 错因:眼瞎没看题,Inf写的0x3f3f3f3f 题解: 类似差分约束的模型,\(a<b\rightarrow a ...
- mount/umount
mount 挂载文件系统 6的 查看当前挂载情况 7的 将文件系统挂载到目录下,这个目录中的文件随着文件系统走,文件系统挂到那,里面的文件就在哪 挂载到其他地方 指定卷标的 指定文件UUID 指定ac ...