Benedikt Kessler (bjk++at++benedikt.munich.sgi.com)
Tue, 10 Dec 1996 15:13:05 +0100
You could attach a pfGeoState object to your geosets where you turn most
things off: lighting, texturing, ...
You could also leave lighting on, but then you should do (sorry for the
C-code):
pfGeoState *gstate;
pfMaterial *mtl;
/**** Make graphics state ****/
gstate = pfNewGState(pfGetSharedArena());
mtl = pfNewMtl(pfGetSharedArena());
pfMtlColorMode(mtl, PFMTL_FRONT, PFMTL_CMODE_AD);
pfGStateAttr(gstate, PFSTATE_FRONTMTL, mtl);
pfGStateMode(gstate, PFSTATE_ENLIGHTING, PF_ON);
...
pfGSetGState(axisX, gstate);
pfGSetGState(axisY, gstate);
pfGSetGState(axisZ, gstate);
Another idea:
You shouldput the three lines in one pfGeoSet using the primitive type
PFGS_LINES and an attribute binding PFGS_PER_PRIM?
Bye! Benedikt
On Dec 10, 1:47pm, Yann Andenmatten wrote:
> Subject: colors problem
> Hello,
>
> I've a problem (certainly easy) that I cannot solve.
>
> I work on a perfly-based application. I've different textured objects
> in a scene, and I want to add an axis system with one color by axis.
> I can see the colors only if I turn the lighting off.
>
> Does it exist a parameter so that my lines (witch should be green, blue
> and red) doesn't appear in white ? (it doesn't seem to be a highlighting
> problem)
>
> Thanks for help
>
> Yann Andenmatten
>
>
> PS : here's my code :
>
> // coordinate system
> axisX = new pfGeoSet();
> axisY = new pfGeoSet();
> axisZ = new pfGeoSet();
>
> /* Define the type of pfGeoSet */
> axisX->setPrimType(PFGS_LINES);
> axisY->setPrimType(PFGS_LINES);
> axisZ->setPrimType(PFGS_LINES);
>
> /* Set the coord of the lines */
> axisX->setAttr(PFGS_COORD3, PFGS_PER_VERTEX, axisXcoord, NULL);
> axisY->setAttr(PFGS_COORD3, PFGS_PER_VERTEX, axisYcoord, NULL);
> axisZ->setAttr(PFGS_COORD3, PFGS_PER_VERTEX, axisZcoord, NULL);
>
> /* Set the color of the lines */
> axisX->setAttr(PFGS_COLOR4, PFGS_PER_VERTEX, axisXColor, NULL);
> axisY->setAttr(PFGS_COLOR4, PFGS_PER_VERTEX, axisYColor, NULL);
> axisZ->setAttr(PFGS_COLOR4, PFGS_PER_VERTEX, axisZColor, NULL);
>
> /* Set the number of lines in the pfGeoSet */
> axisX->setNumPrims(1);
> axisY->setNumPrims(1);
> axisZ->setNumPrims(1);
>
> char buf1[16];
> sprintf(buf1, "coordSysObject\0");
> coordSys = new pfGeode;
> coordSys->addGSet(axisX);
> coordSys->addGSet(axisY);
> coordSys->addGSet(axisZ);
> coordSys->setName (buf1);
>
> char buf2[15];
> sprintf(buf2, "coordSysCoord\0");
> coordSysDCS = new pfDCS;
> coordSysDCS->addChild (coordSys);
> coordSysDCS->setName(buf2);
>
--
+---------------------------------+----------------------------------+
|Benedikt J. Kessler | Silicon Graphics GmbH |
|Training Munich | Am Hochacker 3 - Technopark |
|Silicon Graphics Computer Systems| 85630 Grasbrunn-Neukeferloh, FRG |
| --- __o ,__o | |
| ------_ \<,_ _-\_<, | Phone: (+int) 89 46108-212 or -0 |
|----- (*)/ (*) (*)/'(*) | Fax: (+int) 89 46108-190 or 222|
+---------------------------------+----------------------------------+
|Network: <bjk++at++munich.sgi.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
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:07 PDT