一.OSG简介
二.OSG配置编译
OpenSceneGraph-3.6.2 : http://www.openscenegraph.org/index.php/download-section/stable-releases/
3rdParty_VS2017_v141_x64_V11_small.7z : http://www.openscenegraph.org/index.php/download-section/dependencies/
OpenSceneGraph-Data-3.4.0.zip : http://www.openscenegraph.org/index.php/download-section/data/可能发生的错误:
1.更改CmakeList.txt
set (CMAKE_PREFIX_PATH "osg源代码路径")
2.3rdParty第三方库只编译32位即可
3.VS2010安装目录下的VC->bin中的cvtres.exe,把它重命名,例如我的做法是cvtres[backup].exe。具体原因自行百度COFF和LNK1123。
三.OSG组成模块
OSG主要包含4个库:OSG核心库(Core Library) OSG工具库(NodeKit) OSG插件库 OSG内省库(osgIntrospection)
1.OSG核心库
osg库:基本数据类,负责提供基本场景图类,构建场景图形节点(节点类 状态类 绘制类 向量和矩阵类),一些包含程序特定功能类(命令行解析和错误调试信息等)
2.OSG工具库
3.OSG插件库
4.OSG内省库
四.OSG流程
五.OSG模块
1.OpenThreads(线程模块)
2.osg(核心模块)
#include <osg/Node>
#include <osg/Geode>
#include <osg/Group>
#include <osg/Material>
#include <osg/Depth>
#include <osg/Projection>
#include <osg/MatrixTransform>
#include <osg/Camera>
#include <osg/io_utils>
#include <osg/BlendColor>
#include <osg/BlendFunc>
#include <osg/Point>
#include <osg/ComputeBoundsVisitor>
#include <osg/LineWidth>
3.osgAnimation(动画模块)
4.osgDB(数据库模块)
#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgDB/FileUtils>
#include <osgDB/FileNameUtils>
5.osgFX(效果模块)
#include <osgFX/Scribe>
6.osgGA(交互模块)
#include <osgGA/GUIEventHandler>
#include <osgGA/TrackballManipulator>
7.osgManipulator
#include <osgManipulator/Dragger>
#include <osgManipulator/TranslateAxisDragger>
osgManipulator.lib
osgManipulatord.lib
8.osgParticle
9.osgPresentation
10.osgQt
11.osgShadow
12.osgSim
13.osgTerrain
14.osgText(文本模块)
#include <osgText/Text>
15.osgUI
16.osgUtil(工具模块)
#include <osgUtil/Optimizer>
#include <osgUtil/LineSegmentIntersector> //线段相交类
17.osgViewer(视图模块)
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>