添加纹理,创建iv文件.
//------------例子---------------
int _tmain(int argc, _TCHAR* argv[])
{
//
Widget myWindow = SoXt::init(argv[0]);
if (myWindow == NULL)
exit(1);
SoSeparator *root = new SoSeparator;
root->ref();
SoTexture2 *texture=new SoTexture2;
texture->filename="照片001.jpg";
root->addChild(texture);
SoCoordinate3 *coord=new SoCoordinate3;
coord->point.set1Value(0,0,0,0);
coord->point.set1Value(1,0,1,0);
coord->point.set1Value(2,1,1,0);
coord->point.set1Value(3,1,0,0);
root->addChild(coord);
SoFaceSet *face=new SoFaceSet;
face->numVertices.setValue(4);
root->addChild(face);
// Set up viewer:
SoXtExaminerViewer *myViewer = new SoXtExaminerViewer(myWindow);
myViewer->setSceneGraph(root);
myViewer->setTitle("Examiner Viewer");
myViewer->show();
SoXt::show(myWindow);
SoXt::mainLoop();
SbString ivFile;
ivFile="demo.iv";
SoWriteAction wa;
wa.getOutput()->setBinary(true);
wa.getOutput()->openFile(ivFile.getString());
wa.apply(root);
wa.getOutput()->closeFile();
root->unref();
return 0;
}
http://tanghg678.blog.163.com/blog/static/1292320520070883216195/