随笔分类 - openscenegraph(osg)
摘要:osg::Geode* createIfcPolygon2() { osg::Geode* geode = new osg::Geode(); //face 8 { osg::Geometry* geom_face1 = new osg::Geometry(); osg::Vec3Array* co
阅读全文
摘要:osg绘图的形式 enum Mode { POINTS = GL_POINTS, //点 LINES = GL_LINES, //线 LINE_STRIP = GL_LINE_STRIP, LINE_LOOP = GL_LINE_LOOP, //封闭轮廓 TRIANGLES = GL_TRIANGL
阅读全文
摘要:osg绘制圆柱体 #include <iostream> #include <osgViewer/Viewer> #include <osg/Node> //#include <osgDB/ReadFile> //#include <osgDB/WriteFile> #include <osgUti
阅读全文
摘要:osg Image转opencv Mat osg::ref_ptr<osg::Image> saveOsgImgObj = new osg::Image(); saveOsgImgObj = captureCallback2Obj->getOsgCameraImage(); cv::Mat open
阅读全文
摘要:osg绘制圆锥体 #include <iostream> #include <osgViewer/Viewer> #include <osg/Node> //#include <osgDB/ReadFile> //#include <osgDB/WriteFile> #include <osgUti
阅读全文
摘要:osg绘制球体 #include <iostream> #include <osgViewer/Viewer> #include <osg/Node> //#include <osgDB/ReadFile> //#include <osgDB/WriteFile> #include <osgUtil
阅读全文
摘要:基于BIM IFC osg的塔吊吊装对位模拟系统 osg::Matrix cameraMatrix = osg::Matrix::translate(-centerVec3d) *osg::Matrix::scale(1.0f, 1.0f, sz_value) *osg::Matrix::trans
阅读全文
摘要:osg相机移动时一定要重写 // 得到逆矩阵,标准接口,控制场景 osg::Matrixd CameraController::getInverseMatrix(void) const { std::cout << " getInverseMatrix " << std::endl; osg::Ma
阅读全文
摘要:osg鼠标缩放 bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us) { // 得到x的初始屏幕坐标 float mouseX = ea.getX(); // 得到y的初始屏幕坐标 float mouse
阅读全文
摘要:osg鼠标滚轮类型 enum ScrollingMotion { SCROLL_NONE, SCROLL_LEFT, SCROLL_RIGHT, SCROLL_UP, SCROLL_DOWN, SCROLL_2D }; ###########################
阅读全文
摘要:osg::AnimationPath enum LoopMode { SWING, LOOP, NO_LOOPING }; #################################
阅读全文
摘要:osg键盘编码 enum KeySymbol { KEY_Space = 0x20, KEY_0 = '0', KEY_1 = '1', KEY_2 = '2', KEY_3 = '3', KEY_4 = '4', KEY_5 = '5', KEY_6 = '6', KEY_7 = '7', KEY
阅读全文
摘要:osg控制相机移动 viewer->getCameraManipulator()->setHomePosition(_homeEye,_homeCenter,_homeUp); osg::Vec3d _homeEye; osg::Vec3d _homeCenter; osg::Vec3d _home
阅读全文
摘要:osg绘制胶囊体 #include <iostream> #include <osgViewer/Viewer> #include <osg/Node> //#include <osgDB/ReadFile> //#include <osgDB/WriteFile> #include <osgUti
阅读全文
摘要:osg抓图、截图、保存图片 #include <osgViewer/Viewer> #include <osgViewer/ViewerBase> #include <osgViewer/GraphicsWindow> #include <osg/Node> #include <osg/Geode>
阅读全文
摘要:osg截取场景图片 #include <osgViewer/Viewer> #include <osgViewer/ViewerBase> #include <osgViewer/GraphicsWindow> #include <osg/Node> #include <osg/Geode> #in
阅读全文
摘要:osg实现三视图 #include <osg/Geode> #include <osg/Geometry> #include <osg/LineWidth> #include <osgViewer/Viewer> #include <osgViewer/CompositeViewer> #inclu
阅读全文
摘要:v开头的行是顶点数据, v的行表示是顶点数据之空间坐标(position), vt的行表示是顶点数据之纹理坐标(texture coordinate), vn的行表示是顶点数据之法线向量(normal)。 顶点数据(Vertex data):v 几何体顶点(Geometric vertices)vt
阅读全文
摘要:塔吊模拟 //滑车 box_slider = new osg::Box( osg::Vec3(center_x + tower_width*(14.0f), center_y, index_z - tower_height*1.4f + column_width*4.0f), tower_width
阅读全文
摘要:osg旋转 osg::Matrix matrix_xy_2 = osg::Matrix::translate(-axisPos_xy_2) * osg::Matrix::rotate(quat_xy_2) * osg::Matrix::translate(axisPos_xy_2); #######
阅读全文