osg::NodeVisitor osg3.4.0
x:-89.4588 y:-12.1245 z:-11.7807
x:-89.4588 y:-6.44823 z:-11.7807
x:-89.2164 y:-9.07239 z:-11.811
x:-89.4588 y:-12.1245 z:-11.7807
x:-89.2164 y:-9.07239 z:-11.811
x:-89.2164 y:-15.9458 z:-11.811
x:-89.4588 y:-6.44823 z:-11.7807
x:-89.2164 y:-2.19896 z:-11.811
x:-89.2164 y:-9.07239 z:-11.811
x:-89.4588 y:-6.44823 z:-11.7807
x:-89.4959 y:-2.57999 z:-11.7705
x:-89.2164 y:-2.19896 z:-11.811
x:-89.6451 y:-4.75968 z:-11.7127
x:-89.4959 y:-2.57999 z:-11.7705
x:-89.4588 y:-6.44823 z:-11.7807
x:-89.6451 y:-4.75968 z:-11.7127
x:-89.7325 y:1.15286 z:-11.6649
x:-89.4959 y:-2.57999 z:-11.7705
x:-89.7325 y:1.15286 z:-11.6649
x:-89.6451 y:-4.75968 z:-11.7127
x:-89.8026 y:-2.48957 z:-11.6174
x:-89.8026 y:-2.48957 z:-11.6174
x:-89.8883 y:1.02162 z:-11.5459
#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 <osgGA/TrackballManipulator>
#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 <osgGA/GUIEventHandler>
#include <osgGA/CameraManipulator>
#include <osgGA/StandardManipulator>
#include <osgGA/OrbitManipulator>
#include <osgGA/TrackballManipulator>
#include <osgUtil/IntersectionVisitor>
#include <osgUtil/LineSegmentIntersector> class BoundVisitor :public osg::NodeVisitor
{
public:
BoundVisitor() :osg::NodeVisitor(TRAVERSE_ALL_CHILDREN), _indent()
{
std::cout << "--" << std::endl;
} virtual void apply(osg::Geode &geode)
{
//osg::Drawable *drawable1= geode.getDrawable(0);
unsigned int count = geode.getNumDrawables();
for (int i = ; i < count; i++)
{
osg::Geometry *geometry = geode.getDrawable(i)->asGeometry();
if (!geometry)
{
continue;
} // 顶点数据
osg::Vec3Array* vertices = dynamic_cast<osg::Vec3Array*>(geometry->getVertexArray());
//osg::Vec3Array vertices = geometry->getVertexArray();
int vertexlNum = vertices->size();
for (int j = ; j<vertexlNum; j++) {
//dstSubset.vertexs.push_back(vertices->at(j).x());
//dstSubset.vertexs.push_back(vertices->at(j).y());
//dstSubset.vertexs.push_back(vertices->at(j).z());
std::cout << "x:" << vertices->at(j).x() << " y:" << vertices->at(j).y() << " z:" << vertices->at(j).z() << std::endl;
}
}
} protected:
int _indent;
}; int main()
{
osg::ref_ptr<osgViewer::Viewer> viewer1 = new osgViewer::Viewer;
osg::ref_ptr<osg::Node> node1 = osgDB::readNodeFile("D:\\参考手册\\BIM\\osg\\build1.OSGB");
BoundVisitor bv; node1->accept(bv);
viewer1->setSceneData(node1); viewer1->setUpViewInWindow(, , , , ); return viewer1->run();
}
osg::NodeVisitor osg3.4.0的更多相关文章
- osg::NodeVisitor
[1]osg::Group [2]osg::PositionAttitudeTransform [2]osg::MatrixTransform [3]osg::Geode [2]osg::Matrix ...
- osg::NodeVisitor中计算一个节点对应的世界变换矩阵、法向量、顶点坐标
class MyNodeVisitor:public osg::NodeVisitor { pulic: MyNodeVisitor():osg::NodeVisitor(osg::NodeVisit ...
- win10 + VS2015 + 64位OSG3.4.0
一.下载 1.osg源码 2.整理好的第三方库 3.cmake3.7.1绿色版 4.osg3.4.0数据包 二.编译前的准备工作 在D:\下新建一个OSG文件夹,在其下再新建4个文件夹 D:\OSG\ ...
- win10操作系统vs2010编译osg3.4.0问题解决记录
参考博客:OSG3.4.0+VS2010+WIN10编译及二次开发环境搭建 链接:https://blog.csdn.net/hsc1239653453/article/details/7827856 ...
- osg::NodeVisitor example
[0]osg::Group [1]osg::MatrixTransform [1] osg::MatrixTransform [1]osg::MatrixTransform [2] osg::Geod ...
- vs2016x64&&qt5.7.1编译osg3.4.0&&osgEarth2.7
此文仅备忘: 1.安装VS2013_Cn_Ult 2.安装qt-opensource-windows-x86-msvc2013_64-5.7.1 设置环境变量QTDIR,并将其bin加入到path中. ...
- vs2013x64&&qt5.7.1编译osg3.4.0&&osgEarth2.7
此文仅备忘: 1.安装VS2013_Cn_Ult 2.安装qt-opensource-windows-x86-msvc2013_64-5.7.1 设置环境变量QTDIR,并将其bin加入到path中. ...
- OSG程序设计之osg::NodeVisitor
本文所有内容来自<OpenSceneGraph三维渲染引擎设计与实践>一书. 本文主要讨论的是OSG中节点的访问. 对于节点的访问是从节点接收一个访问器开始的,用户执行某个节点的accep ...
- VS2013环境下配置OSG(3.4.0版本)
参考链接1: http://blog.csdn.net/lonsegdi/article/details/50579439 参考链接2: http://bbs.osgchina.org/forum.p ...
随机推荐
- 基于Java+Selenium的WebUI自动化测试框架(九)-----基础页面类(BasePage)
上篇我们写了java读取xml文件的类,实现了可以从xml文件读取元素的方式.那么,接下来我们需要考虑一个问题.我们拿了这些元素之后怎么去操作呢? 先来看看我们手工测试的时候是怎么进行的. 双击浏览器 ...
- 【胡搞的不能AC的题解,暴力搜索一发博弈问题】1995 三子棋 - 51Nod
1995 三子棋 题目来源: syu校赛 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 原题链接: https://www.51nod.com/onlineJudge/ ...
- ES6中构造函数内super关键字的使用
super关键字用于访问和调用一个对象的父对象上的函数. super.prop和super[expr]表达式在类和对象字面量任何方法定义中都是有效的. 语法 super([arguments]); / ...
- UML类图介绍
一.概述 UML类图用来定义系统中的类,包括描述类的结构和类之间的关系.类图的主要作用于描述系统的静态结构. 类图的基本模型元素如下:
- Django REST framework+Vue 打造生鲜电商项目(笔记五)
一.viewsets实现商品详情页接口 (1)商品详情页只需要多继承一个类(mixins.RetrieveModelMixin)就可以了,(它的功能就是展示商品详情) class GoodsListV ...
- Substring Anagrams
Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings ...
- [RxJS] Convert a Node.js style callback to Observable: bindNodeCallback
It's just like bindCallback, but the callback is expected to be of type callback(error, result). imp ...
- How to troubleshoot the "Could not create 'CDO.Message'" error message
https://support.microsoft.com/en-us/kb/910360 Method 1: Make sure that the Cdosys.dll file is cor ...
- 1.设计模式 - Singleton模式(单件模式)
Singleton是一种创建型模式,指某个类采用Singleton模式,则在这个类被创建后,只可能产生一个实例供外部访问,并且提供一个全局的访问点,一般用于Activity的控制层全局对象和Singl ...
- luogu 4211
题意 存在一棵树,每次询问 \(l, r, z\) 求 \[\sum_{i = l} ^ {r} deep(lca(i, z))\] 考虑 lca 的实质:两点到根的路径的交集中深度最大的点 其中一点 ...