Re: colors problem

New Message Reply Date view Thread view Subject view Author view

Sharon Clay (src++at++rose.asd.sgi.com)
Tue, 10 Dec 1996 11:52:01 -0800


+>---- On Dec 10, 2:00pm, Brian Furtaw wrote:
> Subject: Re: colors problem
->
->I believe your problem is that you have not specified any normals for the
->lines, you could do two things specify normals for the lines (i.e.
->axisX->setAttr(PFGS_NORMAL3, PFGS_PER_VERTEX, axisXnorms, NULL); ) or render
->the lines unlit (i.e. axisX->setPrimType(PFGS_FLAT_LINESTRIPS); ). Of course
->you realize there is the third unspecified option which I am sure someone else
->will cover.

If the lines are to be lit then normals are probably a good suggestion.

However, I think the key problem her eis the lack of a pfGeoState for the
pfGeoSet. Every pfGeoSet should be given a pfGeoState or else the gset will
inherit random stuff from the previous pfGeoState. Once a pfGeoState is
assgined, then the gset will only inherit from the global state as it is
supposed to. The reason for this is that for performance reasons we do
a lazy pop of pfGeoState changes so it takes a new specified pfGeoState to pop off
changes from the previous one. When placed in a scene graph, the previous pfGeoState
that will be drawn is not even known because we sort the pfGeoSets at the end
of the cull before the pfDispList is handed to the draw.

In this case, the pfGeoState should probably
set off the PFSTATE_ENLIGHTING and PFSTATE_ENTEXTURE modes with pfGStateMode().

->
->Brian
->
->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);
->>
->>
->> --
->> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
->> [][][] [][] [][][] [] > Ecole Polytechnique Federale de Lausanne
->> [] [] [] [] [] > Swiss Federal Institute of Technology
->> [][] [][][] [][] [] >
->> [] [] [] [] > Yann Andenmatten, +41.22 693.58.50
->> [][][] [] [] [][][] > yandenmat++at++di.epfl.ch
->> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
->> =======================================================================
->> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
->> Submissions: info-performer++at++sgi.com
->> Admin. requests: info-performer-request++at++sgi.com
->>-- End of excerpt from Yann Andenmatten
->
->--
->o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
->
->Brian Furtaw (brian++at++sgi.com)
->VisSim Technical Consultant
->12200-G Plum Orchard Drive Office: (301)572-3293 Fax: (301)872-3293
->Silver Spring, Maryland 20904 OpenGL/ImageVision/OpenInventor/Performer
->=======================================================================
->List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
-> Submissions: info-performer++at++sgi.com
-> Admin. requests: info-performer-request++at++sgi.com
->
+>---- End of excerpt from Brian Furtaw

-- 
-----{-----{---++at++   -----{----{---++at++   -----{----{---++at++   -----{----{---++at++
Sharon Rose Clay (Fischler) - Silicon Graphics, Advanced Systems Dev.
src++at++sgi.com  (415) 933 - 1002  FAX: (415) 965 - 2658  MS 8U-590
-----{-----{---++at++   -----{----{---++at++   -----{----{---++at++   -----{----{---++at++
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

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:54:08 PDT

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