Hi,
I am new to Inventor, and I am using Red Hat 7.0, which is not officially
supported, so if anybody knows of any problems specifically with Red-Hat 7,
please drop me a letter.
But the main question is as follows:
I have installed all the necessary packages (lesstif, Mesa ..) and
successfully deployed 3 Inventor's RPMs.
When trying to compile the following simplest program, the compiler could
not find Xm.h, which was supposed to be in /usr/lib/Xm. This is the header
file of Motif.
So I tried to install OpenMotif, but it came ( not a miracle) with a
conflict with libraries of lesstiff. After uninstall of Lesstif and
installation of OpenMotif, Inventor could not be installed, since one of
libraries was missing. So what is the reason of all this mess? It is
specified in FAQ, that either motif or lesstif are equally supported.
Then I restored the original installation, and found that there are needed
libraries and header files in /usr/X11R6. Finally I succeeded to compile
the program, but it did not work - it showed only empty brown window,
without any text in it.
I have no idea what is the reason for all this, and would greatly
appreciate any help.
Another question : does anybody know about any sort of incompatibility on
the source code level between Linux version and SGI version of Inventor?
This is the program I talked about:
/* hmw0.c */
#include <Inventor/Xt/SoXt.h>
#include <Inventor/Xt/SoXtRenderArea.h>
#include <Inventor/engines/SoElapsedTime.h>
#include <Inventor/nodes/SoCone.h>
#include <Inventor/nodes/SoDirectionalLight.h>
#include <Inventor/nodes/SoMaterial.h>
#include <Inventor/nodes/SoPerspectiveCamera.h>
#include <Inventor/nodes/SoRotationXYZ.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoText3.h>
main(int , char **argv)
{
// Initialize Inventor and Xt
Widget myWindow = SoXt::init(argv[0]);
if (myWindow == NULL) exit(1);
SoSeparator *root = new SoSeparator;
root->ref();
SoPerspectiveCamera *myCamera = new SoPerspectiveCamera;
root->addChild(myCamera);
root->addChild(new SoDirectionalLight);
// This transformation is modified to rotate the cone
SoRotationXYZ *myRotXYZ = new SoRotationXYZ;
root->addChild(myRotXYZ);
SoMaterial *myMaterial = new SoMaterial;
myMaterial->diffuseColor.setValue(1.0, 0.0, 1.0); //RGB
root->addChild(myMaterial);
// The screen's text
SoText3 *myText = new SoText3;
myText->string = "Hello CG Course";
root->addChild(myText);
// An engine rotates the object. The output of myCounter
// is the time in seconds since the program started.
// Connect this output to the angle field of myRotXYZ
myRotXYZ->axis = SoRotationXYZ::X; // rotate about X axis
SoElapsedTime *myCounter = new SoElapsedTime;
myRotXYZ->angle.connectFrom(&myCounter->timeOut);
SoXtRenderArea *myRenderArea = new SoXtRenderArea(myWindow);
myCamera->viewAll(root, myRenderArea->getViewportRegion());
myRenderArea->setSceneGraph(root);
myRenderArea->setTitle("Hello Computer Graphics Course");
myRenderArea->setBackgroundColor(SbColor(0.35,0.35,0.35));
myRenderArea->setSize(SbVec2s(600,600));
myRenderArea->show();
SoXt::show(myWindow);
SoXt::mainLoop();
}
|