osg fbx 绘制坐标轴、控制模型影藏与显示
int main() { osg::ref_ptr<osgViewer::Viewer> viewer1 = new osgViewer::Viewer; osg::ref_ptr<osg::Group> group1 = new osg::Group; osg::ref_ptr<osg::Group> group2 = new osg::Group; //osg::ref_ptr<osg::Node> node1 = osgDB::readNodeFile("I:\\BIM\\fbx\\jiaoxuelou20190304.fbx"); //osg::ref_ptr<osg::Node> node1 = osgDB::readNodeFile("I:\\BIM\\fbx\\Worker201907.fbx"); //osg::ref_ptr<osg::Node> node1 = osgDB::readNodeFile("I:\\BIM\\fbx\\buildings6.fbx"); //osg::ref_ptr<osg::Node> node1 = osgDB::readNodeFile("I:\\BIM\\fbx\\wdq.fbx"); osg::ref_ptr<osg::Node> node1 = osgDB::readNodeFile("I:\\BIM\\fbx\\wall20190707.fbx"); group1->addChild(node1.get()); group2->addChild(makeCoordinate(10.0, 10.0, 10.0, 4)); group2->addChild(group1.get()); //viewer1->setSceneData(group1.get()); viewer1->setSceneData(group2.get()); viewer1->setUpViewInWindow(200, 200, 800, 600, 0); //遍历节点 std::cout << "--------------------------------" << std::endl; printOsgGroup(group1); //BoundVisitor boundVisitor1; //group1->accept(boundVisitor1); //int nodeChildCount = node1->getNumChildrenRequiringEventTraversal(); //std::cout << "----count:" <<nodeChildCount<< std::endl; viewer1->addEventHandler(new CPickHandler(viewer1)); return viewer1->run(); }
模型节点控制隐藏于显示,只需要调用 节点的 setNodeMask(1);即可,0:隐藏 1:显示
node->setNodeMask(0); //node->setNodeMask(1);
export root node
Node : RootNode
Node : 三维视图: {三维}
eCamera : 涓夌淮瑙嗗浘: {涓夌淮}
Node : 基本墙 wall_240 [361750]
eMesh : 基本墙 wall_240 [361750] Geometry
Node : 基本墙 wall_240 [361813]
eMesh : 基本墙 wall_240 [361813] Geometry
Node : 基本墙 wall_240 [361889]
eMesh : 基本墙 wall_240 [361889] Geometry
Node : 基本墙 wall_240 [361993]
eMesh : 基本墙 wall_240 [361993] Geometry
Node : 基本墙 wall_240 [362170]
eMesh : 基本墙 wall_240 [362170] Geometry
Node : 基本墙 wall_240 [362246]
eMesh : 基本墙 wall_240 [362246] Geometry
Node : 基本墙 wall_240 [362332]
eMesh : 基本墙 wall_240 [362332] Geometry
Node : 基本墙 wall_240 [362620]
eMesh : 基本墙 wall_240 [362620] Geometry
Node : 基本墙 wall_240 [362719]
eMesh : 基本墙 wall_240 [362719] Geometry
Node : 基本墙 wall_240 [362785]
eMesh : 基本墙 wall_240 [362785] Geometry
Node : 基本墙 wall_240 [362853]
eMesh : 基本墙 wall_240 [362853] Geometry
Node : 基本墙 wall_240 [362938]
eMesh : 基本墙 wall_240 [362938] Geometry
Node : 基本墙 wall_240 [363048]
eMesh : 基本墙 wall_240 [363048] Geometry
Node : 基本墙 wall_240 [363150]
eMesh : 基本墙 wall_240 [363150] Geometry
Node : 基本墙 wall_240 [363257]
eMesh : 基本墙 wall_240 [363257] Geometry
Node : 基本墙 wall_240 [363370]
eMesh : 基本墙 wall_240 [363370] Geometry
export root node done
done
--------------------------------
0=三维视图: {三维}
1=基本墙 wall_240 [361750]
2=基本墙 wall_240 [361813]
3=基本墙 wall_240 [361889]
4=基本墙 wall_240 [361993]
5=基本墙 wall_240 [362170]
6=基本墙 wall_240 [362246]
7=基本墙 wall_240 [362332]
8=基本墙 wall_240 [362620]
9=基本墙 wall_240 [362719]
10=基本墙 wall_240 [362785]
11=基本墙 wall_240 [362853]
12=基本墙 wall_240 [362938]
13=基本墙 wall_240 [363048]
14=基本墙 wall_240 [363150]
15=基本墙 wall_240 [363257]
16=基本墙 wall_240 [363370]
0=RootNode
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 软件产品开发中常见的10个问题及处理方法
· .NET 原生驾驭 AI 新基建实战系列:向量数据库的应用与畅想
· 从问题排查到源码分析:ActiveMQ消费端频繁日志刷屏的秘密
· 一次Java后端服务间歇性响应慢的问题排查记录
· dotnet 源代码生成器分析器入门
· ThreeJs-16智慧城市项目(重磅以及未来发展ai)
· .NET 原生驾驭 AI 新基建实战系列(一):向量数据库的应用与畅想
· Ai满嘴顺口溜,想考研?浪费我几个小时
· Browser-use 详细介绍&使用文档
· 软件产品开发中常见的10个问题及处理方法