资源简介
基于OSG实现的雷达波的实时仿真,有直线传播方式和正弦波方式两种,有各种参数可以调节。
代码片段和文件信息
#include “IndirectRadarEffect.h“
#include
#include
#include
#include
namespace RadarEffect
{
osg::ref_ptr createTracingWave(float radius float height osg::Vec4& startColor osg::Vec4& endColor)
{
osg::ref_ptr geode = new osg::Geode;
osg::ref_ptr geom = new osg::Geometry;
osg::ref_ptr vertices = new osg::Vec3Array;
osg::ref_ptr colors = new osg::Vec4Array;
osg::ref_ptr normals = new osg::Vec3Array;
geom->setVertexArray(vertices.get());
geom->setColorArray(colors.get());
geom->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
geom->setNormalArray(normals.get());
geom->setNormalBinding(osg::Geometry::BIND_OVERALL);
normals->push_back(osg::Vec3(0.0 -1.0 0.0));
//下后面,保证定点是逆时针
vertices->push_back(osg::Vec3(radius 0.0 -radius));
vertices->push_back(osg::Vec3(radius height -radius));
vertices->push_back(osg::Vec3(-radius height -radius));
vertices->push_back(osg::Vec3(-radius 0.0 -radius));
colors->push_back(startColor);
colors->push_back(endColor);
colors->push_back(endColor);
colors->push_back(startColor);
//下前面
vertices->push_back(osg::Vec3(radius 0.0 -radius));
vertices->push_back(osg::Vec3(-radius 0.0 -radius));
vertices->push_back(osg::Vec3(-radius -height -radius));
vertices->push_back(osg::Vec3(radius -height -radius));
colors->push_back(startColor);
colors->push_back(startColor);
colors->push_back(endColor);
colors->push_back(endColor);
//左后面
vertices->push_back(osg::Vec3(-radius 0.0 -radius));
vertices->push_back(osg::Vec3(-radius height -radius));
vertices->push_back(osg::Vec3(-radius height radius));
vertices->push_back(osg::Vec3(-radius 0.0 radius));
colors->push_back(startColor);
colors->push_back(endColor);
colors->push_back(endColor);
colors->push_back(startColor);
//左前面
vertices->push_back(osg::Vec3(-radius 0.0 -radius));
vertices->push_back(osg::Vec3(-radius 0.0 radius));
vertices->push_back(osg::Vec3(-radius -height radius));
vertices->push_back(osg::Vec3(-radius -height -radius));
colors->push_back(startColor);
colors->push_back(startColor);
colors->push_back(endColor);
colors->push_back(endColor);
//上后面
vertices->push_back(osg::Vec3(-radius 0.0 radius));
vertices->push_back(osg::Vec3(radius 0.0 radius));
vertices->push_back(osg::Vec3(radius height radius));
vertices->push_back(osg::Vec3(-radius height radius));
colors->push_back(startColor);
colors->push_back(startColor);
colors->push_back(endColor);
colors->push_back(endColor);
//上前面
vertices->push_back(osg::Vec3(-radius 0.0 radius));
vertices->push_back(osg::Vec3(-radius -height radius));
vertices->push_back(osg::Vec3(radius -height radius));
vertices->push_b
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 46 2011-06-18 09:04 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\.svn\dir-prop-ba
文件 528 2011-06-19 23:36 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\.svn\entries
文件 53 2011-06-18 09:02 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\.svn\prop-ba
文件 1376 2011-06-18 09:02 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\.svn\text-ba
文件 18944 2011-06-19 23:36 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\.svn\text-ba
文件 40 2011-06-18 09:05 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\.svn\dir-prop-ba
文件 1287 2011-06-19 23:36 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\.svn\entries
文件 897 2011-06-18 09:02 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\.svn\text-ba
文件 7883 2011-06-19 23:36 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\.svn\text-ba
文件 2128 2011-06-19 23:36 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\.svn\text-ba
文件 1255 2011-06-19 23:36 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\.svn\text-ba
文件 990 2011-06-19 23:36 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\.svn\text-ba
文件 1399 2011-06-18 09:02 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\.svn\text-ba
文件 4272 2011-06-18 09:02 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\.svn\text-ba
文件 11890 2012-04-07 22:17 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\Debug\BuildLog.htm
文件 834963 2012-04-07 22:17 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\Debug\IndirectRadarEffect.obj
文件 65 2012-04-07 22:17 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\Debug\mt.dep
文件 156526 2012-04-07 22:17 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\Debug\RaderEffect.obj
文件 663 2012-04-07 22:17 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\Debug\RaderEffectDll.dll.em
文件 728 2012-04-07 22:17 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\Debug\RaderEffectDll.dll.em
文件 621 2012-04-07 22:17 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\Debug\RaderEffectDll.dll.intermediate.manifest
文件 1035264 2012-04-07 22:17 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\Debug\vc90.idb
文件 2723840 2012-04-07 22:17 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\Debug\vc90.pdb
文件 897 2011-06-18 09:02 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\export.h
文件 15994 2012-02-09 14:26 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\IndirectRadarEffect.cpp
文件 3186 2012-02-09 14:26 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\IndirectRadarEffect.h
文件 1763 2011-08-20 16:30 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\RadarEffect.h
文件 1184 2012-02-09 16:32 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\RaderEffect.cpp
文件 4272 2011-06-18 09:02 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\RaderEffectDll.vcproj
文件 1399 2011-06-19 23:35 RadarEffect(包含有正弦波,由小到大,由大到小,不变多种情况)\RaderEffectDll\RaderEffectDll.vcproj.QingyiZhang-PC.Qingyi Zhang.user
............此处省略55个文件信息
评论
共有 条评论