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 ...
随机推荐
- MyBatis_[tp_48]_动态sql_内置参数_parameter&_databaseId
笔记要点-----内置参数_parameter&_databaseId 用处: 迅速切换数据库,执行一条多分支的sql语句即可;1.定义接口 public interface Emp ...
- mybatis3.1-[topic-16-17]-映射文件_增删改查_insert_获取自增主键的值
笔记要点出错分析与总结 /**测试第16章的增,删,改 的内容 * 错误1: <insert id="addEmp" parameterType="com.bean ...
- seo与python大数据结合给文本分词并提取高频词
最近研究seo和python如何结合,参考网上的一些资料,写的这个程序. 目的:分析某个行业(例如:圆柱模板)用户最关心的一些词,根据需求去自动调整TDK,以及栏目,内容页的规划 使用方法: 1.下载 ...
- 神经网络(3)---如何表示hypothesis,如何表示我们的model
大脑中的神经元 我们的大脑都充满了上图所示的神经元,神经元有一个细胞体(cell body),还有一些input wires,专业词汇叫做树突(dendrite),它们从其它地方接收输入信息,神经元还 ...
- windows nginx 搭建文件服务器(通俗易懂)
在一些项目里面,有时候需要访问图片的时候.相信很多人都是的直接把文件放到项目里面的: 今天在这里给大家介绍的是利用nginx 搭建图片服务器,直接访问磁盘上的图片. 方法一(使用root关键字): l ...
- P1928 外星密码
题目描述 有了防护伞,并不能完全避免 2012 的灾难.地球防卫小队决定去求助外星种族的帮 助.经过很长时间的努力,小队终于收到了外星生命的回信.但是外星人发过来的却是一 串密码.只有解开密码,才能知 ...
- [转]OpenMP中几个容易混淆的函数(线程数量/线程ID/线程最大数)以及并行区域线程数量的确定
说明:这部分内容比较基础,主要是分析几个容易混淆的OpenMP函数,加以理解. (1)并行区域数量的确定: 在这里,先回顾一下OpenMP的parallel并行区域线程数量的确定,对于一个并行区域,有 ...
- 【概率论】5-1:分布介绍(Special Distribution Introduction)
title: [概率论]5-1:分布介绍(Special Distribution Introduction) categories: - Mathematic - Probability keywo ...
- notepad++修改背景色
- Python豆瓣书籍信息爬虫
练习下BeautifulSoup,requests库,用python3.3 写了一个简易的豆瓣小爬虫,将爬取的信息在控制台输出并且写入文件中. 上源码: # coding = utf-8 '''my ...