#include <osgDB/ReadFile>
#include <osgDB/FileUtils>
#include <osg/Group>
#include <osg/ShapeDrawable>
#include <osg/PolygonMode>
#include <osg/LineWidth>
#include <osg/MatrixTransform>
#include <osg/ComputeBoundsVisitor>
#include <osgViewer/Viewer>
osg::ref_ptr<osg::Node> cretateBoundingBox(osg::Node * node)
{
osg::ref_ptr<osg::Geode> geode = new osg::Geode();
osg::ComputeBoundsVisitor boundVisitor;
node->accept(boundVisitor);
osg::BoundingBox boundingBox = boundVisitor.getBoundingBox();
//输出XYZ范围及中心点坐标
osg::notify(o
OSG获取模型XYZ范围并生成最小包围盒
最新推荐文章于 2025-06-11 16:08:23 发布