Re: Rephrase: Objects in strings

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++sgi.com)
Tue, 14 Apr 1998 11:58:31 -0700


William Sherman -Visualization wrote:
>
> > Performers,
> >
> > I have a couple of questions. I'll include the easy one first.
>
> Okay, I blew the easy question by not being clear.
>
> The gist of what I am looking for is not the ability to turn
> strings into Performer objects, but to turn the objects described
> by the strings into Performer objects.
>
> > In some Inventor programs I wrote a while back, I often included
> > ascii descriptions of simple objects directly in the executable,
> > stored as strings. The MakeObject() function then converted the
> > Ascii-Inventor format into a node/graph.
>
> For example (and I know I should have done this the first time),
> if I want to make an object that consists of four cubes arranged
> in a square in an alternating black and white sequence, I can
> describe it in Inventor's ascii forat as:
>
> static char *plumb_marker_str =
> "Separator {"
> " Material { }"
> " DEF plumb_translate Translation { }"
> " Translation { translation -0.5 -0.5 0.5 }"
> " Cube { width 1 height 1 depth 1 }"
> " Translation { translation 1 0 -1 }"
> " Cube { width 1 height 1 depth 1 }"
> " Material { diffuseColor 0 0 0 }"
> " Translation { translation 0 0 1 }"
> " Cube { width 1 height 1 depth 1 }"
> " Translation { translation -1 0 -1 }"
> " Cube { width 1 height 1 depth 1 }"
> "}";
>
> Now (in Inventor), if I want to make a node containing the
> object described by this string, I do the following:
>
> SoSeparator *in_graph;
> in_graph = MakeObject(plumb_marker_str);
> plumb_marker->addChild(in_graph);
>
> > I would like to be able to do this in Performer, but haven't
> > had any luck finding a similar function.
> >
> > Is there an easy way to do this?
> >
> > And, thinking for the future, will this be possible in OpenGL++,
> > or whatever will come out next? I thought it was a really handy
> > feature of Inventor.
>
> I hope this is a little clearer than my previous ambiguous phrasing.
>

Performer has no equivalent of inventors ascii file format, and only
recently aquired the .pfb format for fast file loading.

Cheers,Angus.

-- 
"Only the mediocre are always at their best." -- Jean Giraudoux 

For advanced 3D graphics Performer + OpenGL based examples and tutors: http://www.dorbie.com/ ======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:14 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.