资源简介
编译好的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 遗传算法部分最小二乘
相关资源
- OSG 72集视频教程和资料140620
- keithley2002 example
- osg爆炸仿真及火烟模拟
- (补充)修改output-example,将H.264AAC帧
- 完整中文版Introduction to Lens Design Wit
- Graph Algorithms:Practical Examples in Apach
- Time Series Analysis and Its Applications With
- Bayesian Networks With Examples in R280858
- SysemVue Examples (SystemVue )
- ROS Robotics by Example
- Applied Bayesian Statistics---With R and OpenB
- OpenSceneGraph 3.0 Beginner’s Guide.pdf
- 点云数据读取 使用osg 附带点云数据
- osg显示点云
- windriverworkbench资料
- SELinux by Example Using Security Enhanced Lin
- ROS Robotics By Example - Second Edition_Code.
- OSG入门书籍之一:OpenSceneGraph Quick S
- Blend for Visual Studio 2012 By Example
- osg3.0.0.rar
- 本人亲自编译的最全的64位osg3.4第三方
- 可以在osg3.4+osgEarth2.8中使用的64位VP
- osworkflow-2.8.0-example.war
- osgi自定义控制台命令demo
- OSG与OSGB批量转化工具
- osg入门级教材
- flash game development by example源码
- OSGB模型3MX索引生成工具v0.1.exe
- Progressive Web Application Development by Exa
- CISSP官方學習指南英文第七版
评论
共有 条评论