资源简介
编译好的osg的所有例子的原程序 希望对大家有用
代码片段和文件信息
#include
#include
#include
#include
#include
#include
void writeShader(osg::Shader* shader const std::string& cppFileName const std::string& variableName)
{
osgDB::ofstream fout(cppFileName.c_str());
if (!fout)
{
std::cout<<“Error: could not open file ‘“< }
std::string shaderSource = shader->getShaderSource();
std::string variableString = std::string(“char “)+variableName+std::string(“[] = “);
std::string::size_type startOfLine = 0;
std::string::size_type endOfLine = shaderSource.find_first_of(‘\n‘ startOfLine);
if (endOfLine==std::string::npos)
{
fout< }
else
{
std::string padding(variableString.size()‘ ‘);
fout< startOfLine = endOfLine+1;
endOfLine = shaderSource.find_first_of(‘\n‘ startOfLine);
while (endOfLine != std::string::npos)
{
fout< startOfLine = endOfLine + 1;
endOfLine = shaderSource.find_first_of(‘\n‘ startOfLine);
}
fout< }
std::cout<<“Written shader to ‘“< }
int main( int argc char **argv )
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argcargv);
// set up the usage document in case we need to print out how to use this program.
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+“ is a utility for converting between various input and output databases formats.“);
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+“ [options] filename ...“);
arguments.getApplicationUsage()->addCommandLineOption(“--shader ““Shader file to create a .cpp file for.“);
arguments.getApplicationUsage()->addCommandLineOption(“-h or --help““Display command line parameters“);
// if user request help write it out to cout.
if (arguments.read(“-h“) || arguments.read(“--help“))
{
arguments.getApplicationUsage()->write(std::cout);
return 1;
}
std::string filename;
if (arguments.read(“--shader“filename))
{
osg::ref_ptr shader = osgDB::readShaderFile(filename);
if (shader.valid())
{
std::string name = osgDB::getStrippedName(filename);
std::string invalidCharacters = “-+/\\*=(){}[]:;<>.?@‘~#‘!\““;
s
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6136 2009-01-29 14:17 examples\CMakeLists.txt
文件 85 2008-09-25 16:39 examples\osg2cpp\CMakeLists.txt
文件 3887 2009-02-06 16:27 examples\osg2cpp\osg2cpp.cpp
文件 159 2007-06-25 10:35 examples\osganimate\CMakeLists.txt
文件 9383 2007-06-12 16:20 examples\osganimate\osganimate.cpp
文件 120 2008-11-05 16:45 examples\osganimationmakepath\CMakeLists.txt
文件 12164 2009-01-07 12:24 examples\osganimationmakepath\osganimationmakepath.cpp
文件 112 2008-11-28 15:37 examples\osganimationnode\CMakeLists.txt
文件 11049 2009-01-07 12:24 examples\osganimationnode\osganimationnode.cpp
文件 120 2008-11-05 01:01 examples\osganimationskinning\CMakeLists.txt
文件 10137 2009-02-09 23:59 examples\osganimationskinning\osganimationskinning.cpp
文件 114 2008-11-05 01:01 examples\osganimationsolid\CMakeLists.txt
文件 5045 2009-01-07 12:24 examples\osganimationsolid\osganimationsolid.cpp
文件 120 2008-11-11 20:47 examples\osganimationtimeline\CMakeLists.txt
文件 7982 2009-07-16 13:52 examples\osganimationtimeline\osganimationtimeline.cpp
文件 3480 2008-12-16 21:29 examples\osganimationviewer\AnimtkViewer
文件 6262 2009-01-21 20:02 examples\osganimationviewer\AnimtkViewer.cpp
文件 1438 2008-12-16 21:29 examples\osganimationviewer\AnimtkViewerGUI
文件 11166 2009-01-07 12:24 examples\osganimationviewer\AnimtkViewerGUI.cpp
文件 1410 2008-12-18 14:56 examples\osganimationviewer\AnimtkViewerKeyHandler
文件 2331 2009-02-06 16:27 examples\osganimationviewer\AnimtkViewerKeyHandler.cpp
文件 175 2008-11-05 14:35 examples\osganimationviewer\CMakeLists.txt
文件 91 2008-11-26 12:23 examples\osgautocapture\CMakeLists.txt
文件 11603 2008-11-27 10:45 examples\osgautocapture\osgautocapture.cpp
文件 135 2007-06-25 10:35 examples\osgautotransform\CMakeLists.txt
文件 6840 2008-03-18 16:37 examples\osgautotransform\osgautotransform.cpp
文件 127 2007-06-25 10:35 examples\osgbillboard\CMakeLists.txt
文件 6438 2007-06-12 16:20 examples\osgbillboard\osgbillboard.cpp
文件 170 2007-06-25 10:35 examples\osgblendequation\CMakeLists.txt
文件 5909 2007-06-12 16:20 examples\osgblendequation\osgblendequation.cpp
............此处省略502个文件信息
- 上一篇:2018年3月品优购电商系统开发
- 下一篇:GA-PLS 遗传算法部分最小二乘
相关资源
- OSGB倾斜摄影数据下载182734
- OSG中碰撞检测程序
- 编译好的osgearth
- CUDA_BY_EXAMPLE自带的几个头文件
- osgEarth入门教程免费
- example.zip
- zed-examples-master.zip
- CUDA by example 中文:GPU高性能编程CUD
- zw_MLX90620_Example-master.zip
- osgb倾斜摄影数据转Cesium3dtiles工具
- Unified Power Format(UPF)example
- 10g_mac_example 万兆以太网
- redis-example
- Bmp2Tif example
- osg源码EagleEye,实现类似鹰眼图的效果
- OpenSceneGraph基本渲染理论.pdf
- microchip PIC24F Code Examples
- Qt类向导ClassWizardExample
- 添加大量倾斜摄影测量模型
- QGIS-OSGeo4W-3.10.0-2-Setup-x86_64
- osgb倾斜摄影数据
- 实战Linux编程精髓源代码
- Source Code Examples-Spring Boot in Action;
- swfUpload最新版本2.5 swf + js + example
- OpenSceneGraph入门教程合集及
- TSF 输入法开发 TSF example
- iTween+Examples
- Vue.js 2.x by Example
- ROS by example
- Tkinter GUI Programming By Example 无水印转化
评论
共有 条评论