Re: colors problem

New Message Reply Date view Thread view Subject view Author view

Scott McMillan (scott++at++ht.com)
Tue, 10 Dec 1996 15:31:07 -0500 (EST)


>
> 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.
>
> Brian

Wrong. A normal is used for shading, and what I assume is wanted is bright
segment that appears the same from all directions (no normals are required).

Here's what I would try adding to the code below for diagnostic line segments:

>
> 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);

        pfGeoState *gstate = new pfGeoState();

        // Set up the graphics state - a few are probably not be required,
        // but I think the first one is the important one
        gstate->setMode(PFSTATE_ENLIGHTING, PFTR_OFF);
        gstate->setMode(PFSTATE_TRANSPARENCY, PFTR_OFF);
        gstate->setMode(PFSTATE_ENTEXTURE, PFTR_OFF);
        gstate->setMode(PFSTATE_ENWIREFRAME, PFTR_ON);

        axisX->setGState(gstate);
        axisY->setGState(gstate);
        axisZ->setGState(gstate);

> >
> > 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
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> --
> 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

-- 
  Scott McMillan  |       HT Medical, Inc.      | Developing virtual environ-
   scott++at++ht.com   |      http://www.ht.com      | ment medical and surgical
 Ph: 301-984-3706 | 6001 Montrose Rd., Ste. 902 | simulations and surgery
Fax: 301-984-2104 |     Rockville, MD 20852     | simulation creation tools.

======================================================================= 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.