[cad-linux] Re: executable geometry data. attribute definitions

  • From: phrostie <pfrostie@xxxxxxxxx>
  • To: cad-linux@xxxxxxxxxxxxx
  • Date: Mon, 8 Sep 2003 18:42:35 -0400

On Sunday 07 September 2003 22:12, you wrote:
> > One more chance I considered is that `geometry' files don't
> > necessarily need be flat text files containing geometric data, they
> > can be executable files generating geometric data
>
> wow, really cool
>
> [snip example]
>
> I like this idea very much.

i'll try again, the below is from the InventorMentor examples of openInvetor. 
Renderman(rib) is similar in that it is an extention to C++.  there are 
examples of both online.  do a google search for "renderman companion" or 
"inventor mentor". 


#include <Inventor/Xt/SoXt.h>
#include <Inventor/Xt/viewers/SoXtExaminerViewer.h>
#include <Inventor/nodes/SoCone.h>
#include <Inventor/nodes/SoDirectionalLight.h>
#include <Inventor/nodes/SoMaterial.h>
#include <Inventor/nodes/SoPerspectiveCamera.h>
#include <Inventor/nodes/SoSeparator.h>

main(int , char **argv)
{
        // Initialize Inventor.  This returns a main indow to use.
        // If unsuccessfull, exit.
        Widget myWindow = SoXt::init(argv[0]); //pass the app name
        if (myWindow == NULL) exit(1);

        //Make a scene containing a red cone
        SoSeparator *root = new SoSeparator;
        root->ref();
        SoMaterial *myMaterial = new SoMaterial;
        myMaterial->diffuseColor.setValue(1.0, 0.0, 0.0); // Red
        root->addChild(myMaterial);
        root->addChild(new SoCone);

        //setup viewer
        SoXtExaminerViewer *myViewer = new SoXtExaminerViewer(myWindow);
        myViewer->setSceneGraph(root);
        myViewer->setTitle("Examiner Viewer");
        myViewer->show();

        SoXt::show(myWindow);   //display main window
        SoXt::mainLoop();       //main inventor event loop



-- 
Oh i've slipped the surly bonds of DOS 
and danced the skies on Linux silvered wings.
http://pfrostie.freeservers.com/cad-tastrafy/
//www.freelists.org/webpage/cad-linux


Other related posts: