From: Keith Parkins (kparkins++at++cs.rochester.edu)
Date: 01/10/2001 11:39:00
Marcin,
The geostate is added to the geoset. Here is the code immediately
following what was previously sent:
/* create the geoSet with proper shape */
switch(shape) {
case OBJ_SPHERE:
geoSetPtr = pfdNewSphere(OBJECT_NTRIS, arena);
break;
case OBJ_CUBE:
geoSetPtr = pfdNewCube(arena);
break;
case OBJ_CYLINDER:
geoSetPtr = pfdNewCylinder(OBJECT_NTRIS, arena);
break;
case OBJ_PIPE:
geoSetPtr = pfdNewPipe(1.0, 1.0, OBJECT_NTRIS, arena);
break;
case OBJ_CONE:
geoSetPtr = pfdNewCone(OBJECT_NTRIS, arena);
break;
case OBJ_PYRAMID:
geoSetPtr = pfdNewPyramid(arena);
break;
default:
printf("Error: uknown object type, defaulting sphere \n");
geoSetPtr = pfdNewSphere(OBJECT_NTRIS, arena);
break;
}
pfGSetGState(geoSetPtr, gStatePtr);
pfAddGSet(geodePtr, geoSetPtr);
pfAddChild(dcsPtr, geodePtr);
Do I need to call pfDrawGSet() after this? Also do you have any idea why
the apple inventor file (one of the inventor_eoe.data files) comes up as
white when you open it with perfly, but comes out red when you open it
with ivview?
Thanks for the help!
Keith
On Tue, 9 Jan 2001, Marcin Romaszewicz wrote:
>
> Hi Keith,
>
> In Performer, the only way objects could change color like this is if
> they're missing a geostate and end up inheriting the state of the object
> drawn before them. The reasons that colors change is that state sorting
> works out differently when objects go in and out of view and different
> objects are drawn before the geostate-less objects.
>
> In your email, you show sample code which creates a
> geostate with a material for your cylinders. Are you sure that you've
> applied this geostate to the cylinder geosets? If you have added the
> geostates to the cylinders and you are still seeing the problem, you've
> found a bug, in which case please contact me directly.
>
> -- Marcin
>
>
> On Tue, 9 Jan 2001, Keith Parkins wrote:
>
> > When I load in the apple.iv file with perfly, the object comes up as white
> > instead of red. Is there a way to fix this?
> >
> > A further manifestation of this problem (I believe) is that when I load a
> > number of inventor files into my world and generate some generic
> > cylinders, the colors of the cylinders change as I change my
> > position. When the inventor files aren't loaded, the colors behave as
> > expected. The material and lighting for the generated cylinder is setup as
> > follows:
> >
> > pfMtlColorMode(materialPtr, PFMTL_FRONT, PFMTL_CMODE_OFF);
> > pfMtlColor(materialPtr, PFMTL_DIFFUSE,
> > obj_colors[color][0], obj_colors[color][1],
> > obj_colors[color][2]);
> > pfMtlColor(materialPtr, PFMTL_SPECULAR, 0.0, 0.0, 0.0);
> > pfMtlColor(materialPtr, PFMTL_AMBIENT, 0.0, 0.0, 0.0);
> > pfMtlShininess(materialPtr, 10.25f);
> > pfMtlAlpha(materialPtr, 1.0);
> >
> > /* create the gstate and select the proper material */
> > gStatePtr = pfNewGState(arena);
> > pfGStateMode(gStatePtr, PFSTATE_ENLIGHTING, PF_ON);
> > pfGStateMode(gStatePtr, PFSTATE_TRANSPARENCY, PFTR_ON);
> > pfGStateAttr(gStatePtr, PFSTATE_FRONTMTL, materialPtr);
> >
> > Has anyone had a similar problem? Any ideas as to how to fix this?
> >
> > Thanks!
> > Keith
> >
> > -----------------------------------------------------------------------
> > List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> > Open Development Project: http://oss.sgi.com/projects/performer/
> > Submissions: info-performer++at++sgi.com
> > Admin. requests: info-performer-request++at++sgi.com
> >
>
>
Keith Parkins U of R Computer Science
kparkins++at++cs.rochester.edu Computer Science Building, Room 606
(716)275-1118
This archive was generated by hypermail 2b29 : Wed Jan 10 2001 - 11:39:05 PST