From: Marcin Romaszewicz (marcin++at++asmodean.engr.sgi.com)
Date: 01/09/2001 15:11:36
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
>
This archive was generated by hypermail 2b29 : Tue Jan 09 2001 - 15:11:39 PST