文章分类 - OSG
OpenSceneGraph学习笔记
摘要:自定义窗口大小并且让定义在自定义窗口的什么位置显示,窗口可以拖动。 1 #include <osgDB/ReadFile> 2 #include <osgUtil/Optimizer> 3 #include <osgViewer/Viewer> 4 #include <osgViewer/ViewerEventHandlers> 5 #include <iostream> 6 7 void main( ) 8 { 9 osg::ref_ptr<osg::Node> loadedModel = osgDB::readNode
阅读全文
摘要:最近做camera 的 AI,需要对四元数,欧拉角等要有一定的了解,把前面学习的整理了一下:1。四元数的优势: 三维空间的旋转完全可以由4元数来胜任。传统意义上需要3×3矩阵来进行向量的旋转(4x4矩阵的第四列表示平移)。所以四元数更节省空间,运算速度更快。既然四元数能方便的表示3D旋转,那么对他们进行插值就能产生平滑的旋转效果。劣势可能是比较抽象,不大好理解。而且据说顶点变换还是矩阵效率更高(涉及到平移)。2。四元数的物理意义:Q( x, y, z, w)来表示向量 绕轴 A(ax, ay,az) 旋转alpha则: x = sin(alpha/2)*ax; y = sin(alp
阅读全文
摘要:1 /* OpenSceneGraph example, osgpick.*/ 2 3 /* osgpick sample 4 * demonstrate use of osgUtil/PickVisitor for picking in a HUD or 5 * in a 3d scene, 6 */ 7 8 #include <osgUtil/Optimizer> 9 #include <osgDB/ReadFile> 10 #include <osgViewer/Viewer> 11 #include <osgViewer/CompositeVi
阅读全文

浙公网安备 33010602011771号