模拟雷达扫描的扇形效果
#include<Windows.h>
#include <osgViewer/Viewer>
#include <osgDB/ReadFile>
#include <osgGA/GUIEventAdapter>
#include <osgViewer/ViewerEventHandlers>
#include <osgGA/TrackballManipulator>
#include <osgUtil/Optimizer>
#include <iostream>
#include <math.h>
#include <osg/LineWidth>
using namespace std;
static const double PI = 3.1415926535898;
//创建简单图元
osg::ref_ptr<osg::Node> CreateSimple()
{
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
osg::ref_ptr<osg::Geometry> geom = new osg::Geometry;
//申请一些顶点
osg::ref_ptr<osg::Vec3Array> coords = new osg::Vec3Array;
//申请颜色
osg::ref_ptr<osg::Vec4Array> color = new osg::Vec4Array;
//申请法向量
osg::ref_ptr<osg::Vec3Array> lawline = new osg::Vec3Array;
//限制线宽
osg::ref_ptr<osg::LineWidth> width = new osg::LineWidth;
//设置顶点
geom->setVertexArray(coords.get());