[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的更多相关文章

  1. osg::NodeVisitor中计算一个节点对应的世界变换矩阵、法向量、顶点坐标

    class MyNodeVisitor:public osg::NodeVisitor { pulic: MyNodeVisitor():osg::NodeVisitor(osg::NodeVisit ...

  2. osg::NodeVisitor

    [1]osg::Group [2]osg::PositionAttitudeTransform [2]osg::MatrixTransform [3]osg::Geode [2]osg::Matrix ...

  3. 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 ...

  4. OSG程序设计之osg::NodeVisitor

    本文所有内容来自<OpenSceneGraph三维渲染引擎设计与实践>一书. 本文主要讨论的是OSG中节点的访问. 对于节点的访问是从节点接收一个访问器开始的,用户执行某个节点的accep ...

  5. OSG计时器与时间戳

    static osg::Timer* sendMsgTimer = new osg::Timer; if (sendMsgTimer->time_m()>100)//100ms {// d ...

  6. OSG消息机制之事件处理概述

    OSG的消息机制包括好多个头文件预定义及多个类. 首先,消息接收相关的类当属osgGA::GUIEventHandler和osgGA::GUIEventAdapter这两个类了.前者处理OSG程序与用 ...

  7. OSG中找到特定节点的方法

    OSG中找到特定节点的方法 转自:http://38288890.blog.163.com/blog/static/19612845320072721549504/ 为了在OSG中找到需要的节点并对节 ...

  8. NodeVisitor的使用-遍历Geode节点下的Geometry并获取顶点、法向量等数据

    struct Subset { std::vector<float> vertexs;//位置 std::vector<float> normals;//法向 std::vec ...

  9. NodeVisitor的使用-遍历Geode节点并在它与父节点之间添加一个LOD节点

    #include <osg\NodeVisitor>#include <osg\MatrixTransform>#include <osg\PagedLOD>#in ...

随机推荐

  1. What Does Reconciliation Mean in Accounting

    Account reconciliation is the process of comparing transactions you have recorded using internal rec ...

  2. python中IO多路复用、协程

    一.IO多路复用 IO多路复用:检测多个socket是否已经发生变化(是否已经连接成功/是否已经获取数据)(可读/可写) import socket def get_data(key): client ...

  3. 新闻系统——SQLHelper助手优化

    在前面我们机房重构的时候已经用过了SQLHelper,但当时就是只会应用,知道利用SQLHelper能够帮助我们连接数据库,但对于怎样书写还是不太清楚,今天就揭开这层神秘的面纱,来真正体验如何来编写S ...

  4. python----装饰器(几种常见方式的使用与理解)

    更详细的装饰器,真心实力推荐,里面介绍的很清楚,介绍可见链接:https://blog.csdn.net/buster_zr/article/details/81104551 1.装饰器的理论: (1 ...

  5. 1. let与const

    1.ES6 新增了let命令,用来声明变量.它的用法类似于var,但是所声明的变量,只在let命令所在的代码块内有效. var a = []; for (var i = 0;i<10;i++) ...

  6. mysql - InnoDB存储引擎 死锁问题( Deadlock found when trying to get lock; try restarting transaction )

    刚刚向数据库插入数据的时候出现了这么一段错误 Deadlock found when trying to get lock; try restarting transaction 主要原因(由于无法使 ...

  7. jQuery相关方法9----事件相关

    一.事件冒泡和阻止事件冒泡 <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></s ...

  8. Linux swap的创建与配置

    在Linux下,swap的作用类似Windows系统下的“虚拟内存”.当物理内存不足时,拿出部分硬盘空间当SWAP分区(虚拟成内存)使用,从而解决内存容量不足的情况.Linux下的swap有两种实现形 ...

  9. [HNOI2002]营业额统计 II

    https://www.luogu.org/problemnew/show/2234 将权值离散化,以权值为下标建立权值线段树 #include <bits/stdc++.h> using ...

  10. Codeforces Round #528 (Div. 2)题解

    Codeforces Round #528 (Div. 2)题解 A. Right-Left Cipher 很明显这道题按题意逆序解码即可 Code: # include <bits/stdc+ ...