Open Inventor练习-文件存储
来源:互联网 发布:淘宝网老爹免费购物 编辑:程序博客网 时间:2024/05/16 12:48
Open Invenor采用SoWriteAction或SoOutput写三维数据格式到文件,如下是具体实现。
#define COIN_DLL #define SOWIN_DLL // 加载COIN库文件 #ifdef _DEBUG #pragma comment(lib, "SoWin1d.lib") #pragma comment(lib, "Coin3d.lib") #else #pragma comment(lib, "SoWin1.lib") #pragma comment(lib, "Coin3.lib") #endif // 添加COIN头文件-Window操作显示库和节点库 #include <Inventor/Win/SoWin.h>#include <Inventor/Win/viewers/SoWinExaminerViewer.h>#include <Inventor/nodes/SoCube.h>#include <Inventor/nodes/SoDirectionalLight.h>#include <Inventor/nodes/SoMaterial.h>#include <Inventor/nodes/SoPerspectiveCamera.h>#include <Inventor/nodes/SoTransform.h>#include <Inventor/nodes/SoSeparator.h>#include <Inventor/actions/SoWriteAction.h>int main (int argc, char** argv) {HWND win = SoWin::init(argv[0]);if (win == NULL) exit(1);SoSeparator* root = new SoSeparator;root->ref();SoMaterial* mSilver = new SoMaterial;mSilver->ambientColor.setValue(.2f, .2f, .2f);mSilver->diffuseColor.setValue(.6f, .6f, .6f);mSilver->specularColor.setValue(.5f, .5f, .5f);mSilver->shininess = .5;root->addChild(mSilver);root->addChild(new SoCube);SoWriteAction wa; wa.getOutput()->openFile("test.iv");wa.getOutput()->setBinary(FALSE);wa.apply(root);wa.getOutput()->closeFile();SoWinExaminerViewer* x = new SoWinExaminerViewer(win);x->setSceneGraph(root);x->setTitle("foo");x->show(); SoWin::show(win);SoWin::mainLoop();return 0;}
- Open Inventor练习-文件存储
- Open Inventor练习-文件读取
- Open Inventor练习-iv文件读写显示1
- Open Inventor练习-iv文件读写显示2
- Open Inventor练习-iv文件读写显示3
- Open Inventor练习-iv文件读写显示4
- Open Inventor练习-一维拖拽器SoTranslate1Dragger
- Open Inventor练习-SoElapsedTime引擎作用
- Open Inventor练习-三维物体选择操作
- Open Inventor练习-传感器(SoFieldSensor)功能
- Open Inventor练习-纹理(SoTexture2)
- Open Inventor练习-SoWinExaminerViewer的继承演示
- Open Inventor练习-SoEventCallback,SoKeyboardEvent键盘事件(红绿灯)
- Open Inventor练习-SoRayPickAction和SoMouseButtonEvent点选操作
- Open Inventor练习-SoSelection三维场景中查找功能
- Open Inventor练习-SoSelection节点下三维物体选择功能
- Open Inventor练习-SoWin中SoWinExaminerViewer显示三维场景
- Open Inventor练习-SoWin中SoWinRenderArea显示三维场景
- Linux内核中的do{}while(0)
- 为web服务添加用户认证
- 【二进制的妙用】猫猫的小鱼
- 如何在VC工程生成的exe当中添加不常见的资源(比如说zip包)
- JavaScript、jQuery、Ajax、Json是什么?区别又是什么?
- Open Inventor练习-文件存储
- 终极SVN在windows下的配置 (二) -- Apache2.2配置Subversion(SVN)提示cannot load mod_dav_svn.so解决
- IL汇编语言介绍(译)
- JavaScript在页面上显示时间钟表
- 设置环境变量
- 最大子串和问题(Maximum Subarray)
- sqlite3加密
- asp.net中导出到Excel的方法汇总及导出Excel/Csv格式数据最优方案(C#)
- Java 中文 Unicode 编码转换