随笔分类 -  openscenegraph(osg)

1 2 3 4 5 ··· 9 下一页
摘要:#pragma once #include <osgGA/TrackballManipulator> #include<osgGA/CameraManipulator> #include<osgGA/GUIActionAdapter> #include <osg/Group> #include <o 阅读全文
posted @ 2024-12-28 23:37 西北逍遥 阅读(36) 评论(0) 推荐(0) 编辑
摘要:osg三维场景中拾取鼠标在模型表面的点击点 #include <osg/Group> #include <osg/Geode> #include <osg/ShapeDrawable> #include <osgDB/ReadFile> #include <osgViewer/Viewer> #in 阅读全文
posted @ 2024-11-19 21:26 西北逍遥 阅读(81) 评论(0) 推荐(0) 编辑
摘要:#include <osg/Node> #include <osg/Geode> #include <osg/ShapeDrawable> #include <osgViewer/Viewer> #include <osgGA/GUIEventHandler> // 自定义的视图切换事件处理器 cl 阅读全文
posted @ 2024-04-08 23:31 西北逍遥 阅读(186) 评论(0) 推荐(0) 编辑
摘要:osg qt场景中节点的透明属性消除 { osg::ref_ptr<osg::StateSet> stateState = north_wall_geode->getOrCreateStateSet(); stateState->setMode(GL_BLEND, osg::StateAttribu 阅读全文
posted @ 2024-02-07 22:10 西北逍遥 阅读(37) 评论(0) 推荐(0) 编辑
摘要:#include <opencv2/opencv.hpp> int main() { // 读取图像 cv::Mat image = cv::imread("image.jpg"); // 获取图像的行数和列数 int rows = image.rows; int cols = image.cols 阅读全文
posted @ 2024-02-06 23:57 西北逍遥 阅读(422) 评论(0) 推荐(0) 编辑
摘要:#include <opencv2/opencv.hpp> int main() { // 创建一个空的图片,宽度为500像素,高度为500像素,通道数为3(RGB),数据类型为8位无符号整数 cv::Mat image = cv::Mat::zeros(500, 500, CV_8UC3); // 阅读全文
posted @ 2024-01-25 21:23 西北逍遥 阅读(254) 评论(0) 推荐(0) 编辑
摘要:osg给节点添加材质 #include <osg/Material> #include <osg/Geode> #include <osgDB/ReadFile> #include <osgViewer/Viewer> int main(){ // 创建一个场景节点 osg::ref_ptr<osg 阅读全文
posted @ 2024-01-24 22:00 西北逍遥 阅读(53) 评论(0) 推荐(0) 编辑
摘要:osg绘制粗线条 #include <osg/Geometry> #include <osg/Geode> #include <osgViewer/Viewer> #include <osg/LineWidth> int main() { // 创建几何体对象 osg::ref_ptr<osg::G 阅读全文
posted @ 2024-01-23 20:58 西北逍遥 阅读(150) 评论(0) 推荐(0) 编辑
摘要:#include <osg/Material> #include <osg/Geode> #include <osgDB/ReadFile> #include <osgViewer/Viewer> int main() { // 创建一个场景节点 osg::ref_ptr<osg::Node> ro 阅读全文
posted @ 2024-01-18 17:07 西北逍遥 阅读(105) 评论(0) 推荐(0) 编辑
摘要:opencv转qimage #include <opencv2/opencv.hpp> #include <QImage> #include <QColor> QImage MatToQImage(const cv::Mat &mat) { // 获取图像尺寸和通道数 int width = mat 阅读全文
posted @ 2024-01-18 00:05 西北逍遥 阅读(45) 评论(0) 推荐(0) 编辑
摘要:osg::ref_ptr<osg::Node> root = ...; // 获取场景根节点 // 遍历场景图并删除所有节点 osg::Node::Children::iterator it; for (it = root->getChildren().begin(); it != root->ge 阅读全文
posted @ 2024-01-16 20:28 西北逍遥 阅读(119) 评论(0) 推荐(0) 编辑
摘要:osg设置节点材质 #include <osg/Geode> #include <osg/Material> #include <osgDB/ReadFile> int main() { // 创建一个 Geode 对象 osg::ref_ptr<osg::Geode> geode = new os 阅读全文
posted @ 2024-01-08 23:09 西北逍遥 阅读(42) 评论(0) 推荐(0) 编辑
摘要:#include <osg/Geode> #include <osgText/Text3D> int main() { // 创建场景图 osg::ref_ptr<osg::Group> root = new osg::Group(); osg::ref_ptr<osg::Geode> geode 阅读全文
posted @ 2024-01-02 21:40 西北逍遥 阅读(49) 评论(0) 推荐(0) 编辑
摘要:#include <osg/Node> #include <osgViewer/Viewer> #include <osgDB/ReadFile> #include <osg/ShapeDrawable> int main() { // 创建Box对象 osg::ref_ptr<osg::Box> 阅读全文
posted @ 2024-01-01 21:34 西北逍遥 阅读(39) 评论(0) 推荐(0) 编辑
摘要:osg添加光源 #include <osg/Light>#include <osg/LightSource>#include <osg/Node>#include <osg/Geode>#include <osgDB/ReadFile>#include <osgViewer/Viewer>int m 阅读全文
posted @ 2023-12-31 18:59 西北逍遥 阅读(101) 评论(0) 推荐(0) 编辑
摘要:osg Node节点透明度 osg::ref_ptr<osg::StateSet> stateState = north_wall_geode->getOrCreateStateSet(); stateState->setMode(GL_BLEND, osg::StateAttribute::ON) 阅读全文
posted @ 2023-12-23 00:58 西北逍遥 阅读(60) 评论(0) 推荐(0) 编辑
摘要:osg绘制3D字体 osg::ref_ptr<osgText::Text3D> xText3D = new osgText::Text3D(); xText3D->setFont("font/arial.ttf"); xText3D->setCharacterSize(30); xText3D->s 阅读全文
posted @ 2023-12-19 21:36 西北逍遥 阅读(17) 评论(0) 推荐(0) 编辑
摘要:osg创建立方体 osg::Geode* createBox(double minX, double maxX, double minY, double maxY, double minZ, double maxZ) { double X1 = minX; double X2 = maxX; dou 阅读全文
posted @ 2023-03-16 21:33 西北逍遥 阅读(87) 评论(0) 推荐(0) 编辑
摘要:osg绘制闭合曲线 osg::TessellationHints* outline_hits1 = new osg::TessellationHints(); outline_hits1->setDetailRatio(0.9f); osg::Geode* outline_geode = new o 阅读全文
posted @ 2022-06-22 23:41 西北逍遥 阅读(305) 评论(0) 推荐(0) 编辑
摘要:塔吊花车移动计算 void TowerPanel::slotMoveSlider(int sliderValue) { slider_length = sliderValue*1.0f; hook_position_x = center_x*(-0.0f) + slider_length*cos(a 阅读全文
posted @ 2022-05-06 20:40 西北逍遥 阅读(41) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 9 下一页
点击右上角即可分享
微信分享提示