OSG基本图元(上)
```cpp #include <Windows.h> #include <iostream> #include<osgDB/ReadFile> #include<osgGA/GUIEventAdapter> #include<osgViewer/Viewer> #include<osg/Geode> #include<osg/ShapeDrawable> #include<osgDB/ReadFile> #include<osg/Material> #include<osg/StateSet> osg::ref_ptr<osg::Geode> CreateBox() { osg::ref_ptr<osg::Geode> geode = new osg::Geode; osg::ref_ptr<osg::TessellationHints> hints = new osg::TessellationHints; osg::ref_ptr<osg::ShapeDrawable> shape = 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> material = new osg::Material; osg::ref