Rudy Darken (darken++at++enews.nrl.navy.mil)
Tue, 7 Jun 94 14:20:49 -0400
This is the third pass at this problem. There have been two suggestions
made by Michael Jones and Jim Helman which have been incorporated into
the code stub below. The problem persists. When the only object in view
is the grid, it is drawn in blue (as expected). However, when another
object enters the view, the grid loses its color and goes dark. I have
this code written into smallfly so it is the only non-sgi code in the
application. The problem has to be in the way I define the geostate for
the grid.
>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, 0.0f, 0.0f, 1.0f);
pfMtlColor (material, PFMTL_DIFFUSE, 0.0f, 0.0f, 1.0f);
// Michael Jones had me add this line
pfMtlColorMode (material, PFMTL_FRONT, LMC_AD);
geostate = pfNewGState (arena);
pfGStateAttr (geostate, PFSTATE_FRONTMTL, material);
pfGStateMode (geostate, PFSTATE_CULLFACE, PFCF_OFF);
// Jim Helman had me add this line
pfGStateMode (geostate, PFSTATE_ENTEXTURE, PF_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
_______________________________________________________________
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:19 PDT