ICode9

精准搜索请尝试: 精确搜索
  • osg绘制圆柱体2021-10-11 11:32:32

    osg绘制圆柱体   #include <iostream> #include <osgViewer/Viewer> #include <osg/Node> //#include <osgDB/ReadFile> //#include <osgDB/WriteFile> #include <osgUtil\Optimizer> #include <osg/Geode> #include <osg/Group&

  • osg给节点染色2021-10-07 16:33:35

    osg给节点染色 osg::ref_ptr<osg::ShapeDrawable> draw_h_bar_index = new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0, 0.0, 0.0), 1.0, 10.0, 10.0)); //设置材质 osg::ref_ptr<osg::Material> column_material = new osg::Material; //设置环境光 column_material->

  • osg Image转opencv Mat2021-10-03 19:00:42

    osg Image转opencv Mat   osg::ref_ptr<osg::Image> saveOsgImgObj = new osg::Image(); saveOsgImgObj = captureCallback2Obj->getOsgCameraImage(); cv::Mat opencv_img(saveOsgImgObj->t(), saveOsgImgObj->s(), CV_8UC3); opencv_img.data = (uchar *)sa

  • osg绘制圆锥体2021-10-03 12:00:38

    osg绘制圆锥体   #include <iostream> #include <osgViewer/Viewer> #include <osg/Node> //#include <osgDB/ReadFile> //#include <osgDB/WriteFile> #include <osgUtil\Optimizer> #include <osg/Geode> #include <osg/Group&

  • osg绘制球体2021-10-02 12:33:17

    osg绘制球体 #include <iostream> #include <osgViewer/Viewer> #include <osg/Node> //#include <osgDB/ReadFile> //#include <osgDB/WriteFile> #include <osgUtil\Optimizer> #include <osg/Geode> #include <osg/Group>

  • 基于BIM IFC osg的塔吊吊装对位模拟系统2021-10-01 21:34:39

    基于BIM IFC osg的塔吊吊装对位模拟系统 osg::Matrix cameraMatrix = osg::Matrix::translate(-centerVec3d) *osg::Matrix::scale(1.0f, 1.0f, sz_value) *osg::Matrix::translate(osg::Vec3(hook_position_x, hook_position_y, hook_position_z))

  • osg键盘编码2021-09-28 09:01:17

    osg键盘编码   enum KeySymbol { KEY_Space = 0x20, KEY_0 = '0', KEY_1 = '1', KEY_2 = '2', KEY_3 = '3', KEY_4 = 

  • osg绘制胶囊体2021-09-27 08:33:58

    osg绘制胶囊体   #include <iostream> #include <osgViewer/Viewer> #include <osg/Node> //#include <osgDB/ReadFile> //#include <osgDB/WriteFile> #include <osgUtil\Optimizer> #include <osg/Geode> #include <osg/Group&

  • osg实现三视图2021-09-24 16:37:01

    osg实现三视图   #include <osg/Geode> #include <osg/Geometry> #include <osg/LineWidth> #include <osgViewer/Viewer> #include <osgViewer/CompositeViewer> #include <osgDB/ReadFile> #include <osgDB/WriteFile> #include <

  • 第36.3节 动画-路径动画生成要点2021-09-13 20:02:58

    目录 本功功能实现要点路径生成人物加载以下是所有代码 本功功能 本节我们在场景中创建了3个关键点,连成一条线,一个小人会从第一个点,跑到最后一个点,如图所示: 本节的内容在网盘中,目录为/osgChina站长文集/文件中的附件/, 有附件的会根据节的编号存放在该目录: 请使用浏览器

  • 塔吊模拟2021-09-12 20:02:47

    塔吊模拟 //滑车 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*1.0f, tower_length*1.0f, tower_height*0.2f

  • 首色器2021-09-08 16:02:06

    #include <Windows.h> #include <iostream> #include <string> #include <osg/Node> #include <osg/Group> #include <osg/Geode> #include <osgViewer/Viewer> #include <osgGA/StateSetManipulator> #include <osgDB/

  • 自定义漫游器2021-09-07 19:35:29

    1 前视图(正视图) 2 后视图 3 右视图 4 左视图 5 上视图(顶视图) 6 下视图(仰视图) class ViewManipulator : public osgGA::TrackballManipulator { public: virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa) override { switch (ea.getEventT

  • 光照模型2021-09-07 18:03:11

    光源类型 定向光 当一个光源很远的时候,来自光源的每条光线接近于平行。这看起来就像所有的光线来自于同一个方向,无论物体和观察者在哪儿。当一个光源被设置为无限远时,它被称为定向光(Directional Light),因为所有的光线都有着同一个方向;它会独立于光源的位置。 //光源位置 第四个

  • osg旋转2021-09-03 16:02:24

    osg旋转 osg::Matrix matrix_xy_2 = osg::Matrix::translate(-axisPos_xy_2) * osg::Matrix::rotate(quat_xy_2) * osg::Matrix::translate(axisPos_xy_2);       #####################

  • HUD2021-09-02 21:32:30

    显示文本; 显示纹理; #include <Windows.h> #include <osg/Node> #include <osg/Group> #include <osg/Geode> #include <osg/Camera> #include <osg/Texture2D> #include <osgViewer/Viewer> #include <osgDB/ReadFile> #include &

  • 绘制四边形2021-08-25 16:32:11

    绘制四边形 点显示 osg::PolygonMode::POINT 线显示 osg::PolygonMode::LINE 面显示 osg::PolygonMode::FILL #include <windows.h> #include <osg\node> #include <osg\group> #include <osg\geometry> #include <osg\matrixtransform> #include <o

  • osg绘制圆2021-08-19 21:03:26

    osg绘制圆   自定义圆的半径,然后根据圆的计算公式   X2 +Y2=R2   (圆的标准方程)生成圆周上的每个坐标点   float getY(int x,bool isPositive) { float y = 0.0f; if (isPositive) { y = sqrt((radius*radius)-(x*x))*1.0f; } else {

  • 用自己的程序解析自己编写的IFC文件(ifcslab),然后用三维引擎渲染出来2021-08-18 12:04:08

    最近根据IFC标准,自己手工编写了一个描述不规则楼板的ifc文件——ifcslab,编写程序解析该ifc文件,获取ifcslab的属性,最后通过三维引擎渲染出来了。   渲染效果如下:       #include <osgViewer/Viewer> #include <osg/Node> #include <osg/Group> #include <osg/ShapeDrawable>

  • 学习OSG的事项总结2021-07-24 10:00:05

    1、电脑没网,使用手机usb共享网络连接不上,在插上USB的时候选择“仅充电”; 自身工程环境配置 1、环境变量: 在系统变量里添加 环境变量 D:\osgsubject\Qt\Qt5.12.3\5.12.3\msvc2015_64\bin D:\osgsubject\osg3.6.3+osgearth2.10+qt5.12\bin D:\osgsubject\osg3.6.3+osgearth2.10

  • osg物体绕自身轴旋转2021-07-21 15:32:19

    如果一个模型不在场景的中心点,这时候使用 osg::Matrix::rotate旋转的话,这个对象会围绕场景的中心点进行旋转,会转一个大圈,那么怎么做才能让他在任何位置的时候,围绕自己的轴心进行旋转?可以使用osg::PositionAttitudeTransform这个类来实现。 代码如下 : #include <windo

  • osgDB机制2021-07-12 11:02:36

    osgDB机制概述   osgDB库允许用户程序加载、使用和写入3D数据库,它采用插件管理的架构,可以支持大量常见的2D图形和3D图形文件格式。osgDB负责维护插件的信息注册表,并负责检查将要被载入的OSG插件接口的合法性。由于大型3D地形数据通常是多段数据块的组合体,因此,应用程序从文件中读

  • OSG数据加载性能优化:纹理压缩2021-07-06 09:03:13

    1、理论知识 我们都知道,纹理的存储是RGBA,这四个数字假如不压缩的话其占用的存储空间是相当大的,每个通道按0~255 一个字节来计算,一个像素RGBA是4个字节(byte),一个1024x1024这么大的图片会占用1024x1024x4=4M。如果不经压缩,一个GPU显存在4GB的显卡,也只能存储1024张1024x1024的图

  • OSG数据加载性能优化:合并几何体2021-07-05 14:02:47

    1、理论知识 OSG最终绘制的都是osg::Geometry,然后Geometry会存放在Node里。比如我们要绘制10条线,那么我们有两种方法,一种方法是定义10个Geometry,每个Geometry定义两个顶点绘制1条线。另一个方法是我们定义1个Geometry,里面放20个顶点,一次性绘制10条线。这两种方法的性能差异很

  • 第16节 调试-粒子系统放在地球上,不见了2021-07-04 16:01:45

    致谢 感谢网友提出这个问题。大家有问题也可以在评论区提出,有问必有答。 问题描述 粒子系统在OSG里好好的,结果放在地球上就看不见了。将代码发给了我,让我长个眼看看。也欢迎大家把问题发给我调试。 本节代码在网盘中: 注意: 务必使用浏览器打开: 链接:https://pan.baidu.com/s/13

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有