osg::NodeVisitor example
[0]osg::Group
[1]osg::MatrixTransform
[1] osg::MatrixTransform
[1]osg::MatrixTransform
[2] osg::Geode
[3]osg::Geometry
[3]osg::Geometry
[3] osg::Geometry
[2]osg::Geode
[1] osg::MatrixTransform
[1]osg::MatrixTransform
[2]osg::MatrixTransform
[3] osg::Geode
[4]osg::Geometry
[4]osg::Geometry
[4] osg::Geometry
[3]osg::Geode
[2] osg::MatrixTransform
[1] osg::MatrixTransform
[1]osg::MatrixTransform
[2] osg::Geode
[3]osg::Geometry
[3]osg::Geometry
[3]osg::Geometry
[3] osg::Geometry
[3]osg::Geometry
[3] osg::Geometry
[2]osg::Geode
[1] osg::MatrixTransform
[1]osg::MatrixTransform
[2] osg::Geode
[3]osg::Geometry
[3]osg::Geometry
[3] osg::Geometry
[2]osg::Geode
[1] osg::MatrixTransform
[1]osg::MatrixTransform
[2] osg::Geode
[3]osg::Geometry
[3]osg::Geometry
[3] osg::Geometry
[2]osg::Geode
[1] osg::MatrixTransform
[1]osg::MatrixTransform
[2] osg::Geode
[3]osg::Geometry
[3]osg::Geometry
[3]osg::Geometry
[3] osg::Geometry
[3]osg::Geometry
[3] osg::Geometry
[2]osg::Geode
[1] osg::MatrixTransform
[1]osg::MatrixTransform
[2]osg::MatrixTransform
[3] osg::Geode
[4]osg::Geometry
[4]osg::Geometry
[4]osg::Geometry
[4]osg::Geometry
[4] osg::Geometry
[4]osg::Geometry
[4] osg::Geometry
[4]osg::Geometry
[4] osg::Geometry
[3]osg::Geode
[2] osg::MatrixTransform
[1] osg::MatrixTransform
[1]osg::MatrixTransform
[2] osg::Geode
[3]osg::Geometry
[3]osg::Geometry
[3] osg::Geometry
[2]osg::Geode
[1] osg::MatrixTransform
[0] osg::Group
class InfoVisitor : public osg::NodeVisitor
{
public:
InfoVisitor()
:osg::NodeVisitor(TRAVERSE_ALL_CHILDREN), _indent()
{} virtual void apply(osg::Node& node)
{
for (int i = ; i < _indent; i++) std::cout << " ";
std::cout << "[" << _indent << "]" << node.libraryName()
<< "::" << node.className() << std::endl; _indent++;
traverse(node);
_indent--; for (int i = ; i < _indent; i++) std::cout << " ";
std::cout << "[" << _indent << "] " << node.libraryName()
<< "::" << node.className() << std::endl;
} virtual void apply(osg::Geode& node)
{
for (int i = ; i < _indent; i++) std::cout << " ";
std::cout << "[" << _indent << "] " << node.libraryName()
<< "::" << node.className() << std::endl; _indent++; for (unsigned int n = ; n < node.getNumDrawables(); n++)
{
osg::Drawable* draw = node.getDrawable(n);
if (!draw)
continue;
for (int i = ; i < _indent; i++) std::cout << " ";
std::cout << "[" << _indent << "]" << draw->libraryName() << "::"
<< draw->className() << std::endl;
} traverse(node);
_indent--; for (int i = ; i < _indent; i++) std::cout << " ";
std::cout << "[" << _indent << "]" << node.libraryName()
<< "::" << node.className() << std::endl;
}
private:
int _indent;
};

该模型在unity3d中结构

该模型在3dmax中结构

osg::NodeVisitor example的更多相关文章
- osg::NodeVisitor中计算一个节点对应的世界变换矩阵、法向量、顶点坐标
class MyNodeVisitor:public osg::NodeVisitor { pulic: MyNodeVisitor():osg::NodeVisitor(osg::NodeVisit ...
- osg::NodeVisitor
[1]osg::Group [2]osg::PositionAttitudeTransform [2]osg::MatrixTransform [3]osg::Geode [2]osg::Matrix ...
- osg::NodeVisitor osg3.4.0
x:-89.4588 y:-12.1245 z:-11.7807x:-89.4588 y:-6.44823 z:-11.7807x:-89.2164 y:-9.07239 z:-11.811x:-89 ...
- OSG程序设计之osg::NodeVisitor
本文所有内容来自<OpenSceneGraph三维渲染引擎设计与实践>一书. 本文主要讨论的是OSG中节点的访问. 对于节点的访问是从节点接收一个访问器开始的,用户执行某个节点的accep ...
- OSG计时器与时间戳
static osg::Timer* sendMsgTimer = new osg::Timer; if (sendMsgTimer->time_m()>100)//100ms {// d ...
- OSG消息机制之事件处理概述
OSG的消息机制包括好多个头文件预定义及多个类. 首先,消息接收相关的类当属osgGA::GUIEventHandler和osgGA::GUIEventAdapter这两个类了.前者处理OSG程序与用 ...
- OSG中找到特定节点的方法
OSG中找到特定节点的方法 转自:http://38288890.blog.163.com/blog/static/19612845320072721549504/ 为了在OSG中找到需要的节点并对节 ...
- NodeVisitor的使用-遍历Geode节点下的Geometry并获取顶点、法向量等数据
struct Subset { std::vector<float> vertexs;//位置 std::vector<float> normals;//法向 std::vec ...
- NodeVisitor的使用-遍历Geode节点并在它与父节点之间添加一个LOD节点
#include <osg\NodeVisitor>#include <osg\MatrixTransform>#include <osg\PagedLOD>#in ...
随机推荐
- 多个ip地址匹配正则表达式
匹配规则:多个ip地址使用,号进行分割 例如:1.1.1.1,2.2.2.2var iplist =/^((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}( ...
- Maven配置环境变量
Windows: 1:新建系统M2_HOME变量,并把安装maven路径拷贝上去 2:配置path变量,并把maven路径拷贝上去,这次的maven路径到bin 3:测试maven环境是否配置 ...
- 切换Python环境 linux终端命令行
切换Python环境 conda info -e // 查看有什么环境 source activate env //切换环境 linux终端分屏 terminator https://www.jia ...
- PHP 根据域名和IP返回不同的内容
遇到一个好玩的事情,访问别人的IP和别人的域名返回的内容竟然不一样.突然觉得很好玩,也很好奇.自己研究了一下下,就简单写一下吧~ 一个IP和一个域名, 先讲一下公网IP没有绑定域名,但是可以通过一个没 ...
- QShareMemory
Qt提供了一种安全的共享内存的实现QSharedMemory,以便在多线程和多进程编程中安全的使用.比如说QQ的聊天的客户端,这里有个个性头象,当点击QQ音乐播放器的时候,启动QQ音乐播放器(启动一Q ...
- Luogu5072 [Ynoi2015]盼君勿忘 【莫队】
题目描述:对于一个长度为\(n\)的序列,\(m\)次询问\(l,r,p\),计算\([l,r]\)的所有子序列的不同数之和\(\mathrm{mod} \ p\). 数据范围:\(n,m,a_i\l ...
- Windows10下安装Ubuntu18.04LTS详细教程
这篇文章分享自己在Windows10系统下安装VMware虚拟机,然后在VMware中安装Ubuntu 18.04 LTS的详细过程.之所以选择在虚拟机中安装Ubuntu,主要是可以不影响自己电脑的正 ...
- 在默认使用apache中央仓库时, 报错 protocol_version
https://cloud.tencent.com/developer/ask/136221/answer/241408 2018年6月,为了提高安全性和符合现代标准,不安全的TLS 1.0和1.1协 ...
- 在Spring中读取properties文件
1.配置文件(*.properties)往往通过以下方式注册在Spring IOC中. <!-- JDBC配置 --> <context:property-placeholder l ...
- C++标准库分析总结(七)——<Hashtable、Hash_set、Hash_multiset、unordered容器设计原则>
编译器对关联容器的实现有两个版本,上一节总结了以红黑树做为基础的实现版本,这一节总结以哈希表(hash table,散列表)为底部结构的实现版本. 一.Hashtable简单介绍 Hashtable相 ...