设为首页 加入收藏

TOP

Open Inventor的VRML2转换SoToVRML2Action
2014-11-23 22:08:19 来源: 作者: 【 】 浏览:0
Tags:Open Inventor VRML2 转换 SoToVRML2Action
view plaincopy to clipboardprint
#include
#include
#include
#include
#include
#include
#include
#include
int
main(int argc, char *argv[])
{
SoDB::init();
SoInteraction::init();
SoInput in;
in.openFile(argv[1]);
printf("Reading... ");
SoSeparator *root = SoDB::readAll(&in);
if (root) {
root->ref();
SbString hdr = in.getHeader();
in.closeFile();
printf("Converting... ");
SoToVRML2Action tovrml2;
tovrml2.apply(root);
SoVRMLGroup *newroot = tovrml2.getVRML2SceneGraph();
newroot->ref();
root->unref();
printf("Writing... ");
SoOutput out;
out.openFile("out.wrl");
out.setHeaderString("#VRML V2.0 utf8");
SoWriteAction wra(&out);
wra.apply(newroot);
out.closeFile();
newroot->unref();
}
return 0;
}
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇代码意识流――花朵数问题(七) 下一篇pthread_cond

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: