line rendering in performer (the sequel)

New Message Reply Date view Thread view Subject view Author view

Rudy Darken (darken++at++enews.nrl.navy.mil)
Tue, 7 Jun 94 12:09:21 -0400


What I want to do is the following:
1. Create a geode
2. Create a material
3. Set the material colors (diffuse & ambient)
4. Create line geometry
5. Bind the material to the lines
6. Return the geode for inclusion in the performer rendering database

It would seem that this should be a common thing to want to do. Obviously,
I want the material properties of the lines to remain constant throughout
the process. I don't want them inheriting state from other geometry. In
fact, since line rendering does not benefit greatly by a lighting model,
I don't even care if they are lighted, provided other objects in my scene
still can be. I have tried all suggestions so far with the same results.
Hasn't anyone rendered lines before? How do you get line geometry to keep
its state without inheriting?

   void *arena;
   pfGeode *geode;
   pfMaterial *material;
   pfGeoState *geostate;
   pfGeoSet *gset;
   pfVec3 *vertices;
   pfVec4 *colors;
    
   arena = pfGetSharedArena ();
   geode = pfNewGeode ();
   material = pfNewMtl (arena);
   pfMtlColor (material, PFMTL_AMBIENT, color[0], color[1], color[2]);
   pfMtlColor (material, PFMTL_DIFFUSE, color[0], color[1], color[2]);
    
   // What goes here?
   // pfMtlColorMode ()?
   // pfMtlSide ()?
    
   geostate = pfNewGState (arena);

   // Is this correct?
   pfGStateAttr (geostate, PFSTATE_FRONTMTL, material);
   pfGStateMode (geostate, PFSTATE_CULLFACE, PFCF_OFF);
    
   gset = pfNewGSet (arena);
   pfGSetPrimType (gset, PFGS_LINES);
   pfGSetGState (gset, geostate);
   // Load geometry here
   pfGSetAttr (gset, PFGS_COORD3, PFGS_PER_VERTEX, vertices, NULL);
   pfGSetAttr (gset, PFGS_COLOR4, PFGS_PER_VERTEX, colors, NULL);
   pfAddGSet (geode, gset);
   return geode;

_______________________________________________________________
Rudy Darken <202> 767-6814
darken++at++enews.nrl.navy.mil The U.S. Naval Research Laboratory
darken++at++seas.gwu.edu The George Washington University
_______________________________________________________________


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:50:19 PDT

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