16、osg中使用Imposter设置一个视矩,超过这个视距模型会变为一张动态图
2015-12-16 22:28
369 查看
代码如下:
// fountain.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <osgViewer/Viewer> #include <osgGA/TrackballManipulator> #include <osgSim/Impostor> #include <osgDB/ReadFile> int _tmain(int argc, _TCHAR* argv[]) { //申请viewer osgViewer::Viewer viewer ; //读取模型 osg::Node * node = osgDB::readNodeFile ("ceep.ive") ; //申请一个impostor结点 osgSim::Impostor * sim = new osgSim::Impostor ; //在0到50000之内显示模型,之外显示贴图 sim->addChild (node,0,50000) ; sim ->setImpostorThreshold(1000) ; osg::Group* root = new osg::Group; root ->addChild (sim) ; viewer.setSceneData( root ); viewer.realize(); viewer.run(); return 0; }效果图如下:
相关文章推荐
- 动态刷新页面(滚动页面)
- 蓝牙核心技术概述(一):蓝牙概述
- svn win
- ByteBuffer小结
- python基础知识
- HDU 1030 Delta-wave 模拟
- leetcode -- Word Search I & II -- dfs 重点
- Does Oracle GoldenGate requires Xlc.Adt.Include 8.0 (文档 ID 1147116.1)
- 求平均排序MATLAB code
- js实现的ajax对象创建&与服务器交互
- jmeter之正则表达式写法实例推荐
- java设计模式(七)--迭代器模式
- 【 bzoj 3992 】 [SDOI2015]序列统计 - NTT 生成函数
- java设计模式
- HashMap多线程死循环问题
- Centos 之find详解
- py环境安装
- 几道很有趣的面试题
- 十大最佳PS3游戏推荐
- 【图像处理】颜色空间