dnf install Inventor-devel InventorXt-devel Inventor-data Inventor-examples Inventor-demos

zkopirovat /usr/lib64/Inventor/examples

adresar example/Mentor/CXX
make
./02.1.HelloCone
#include <Inventor/nodes/SoCube.h>
#include <Inventor/nodes/SoRotationXYZ.h>
#include <Inventor/engines/SoElapsedTime.h>
#include <Inventor/manips/SoTrackballManip.h>
   SoMaterial *myMaterial = new SoMaterial;
   myMaterial->diffuseColor.setValue(1.0, 0.0, 0.0);
   root->addChild(myMaterial);
 
   // This transformation is modified to rotate the cone
   SoRotationXYZ *myRotXYZ = new SoRotationXYZ;
   myRotXYZ->axis = SoRotationXYZ::Z;
   myRotXYZ->angle = 3.14 / 4;
   root->addChild(myRotXYZ);
 
   root->addChild(new SoCone);
 
   SoMaterial *myMaterial2 = new SoMaterial;
   myMaterial2->diffuseColor.setValue(0.0, 0.0, 1.0);
   root->addChild(myMaterial2);
 
   root->addChild(new SoTrackballManip);  
 
   SoCube * c = new SoCube;
   c->height = 0.2;
   root->addChild(c);
 
   SoElapsedTime *myCounter = new SoElapsedTime;
   myRotXYZ->angle.connectFrom(&myCounter->timeOut);

make 02.4.Examiner && ./02.4.Examiner

 
openinventor2019.txt · Last modified: 2019/12/02 14:58 by 147.32.8.115
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki