Re: problem with normals

New Message Reply Date view Thread view Subject view Author view

Brian Furtaw (brian++at++sgi.com)
Thu, 27 Feb 1997 09:50:59 -0500


You need to make a change to the pfGeoState attributes you defined below. Look
at the ENLIGHTING attribute you have it turned off which means flat shade this
object, you need it to be on.

On Feb 27, 9:01am, Yann Andenmatten wrote:
> Subject: problem with normals
> Hi,
>
> I've create an object (a cylinder) without texture, but with colors. The
> problem is that the object is colored with the colors, but it ignores the
> light...
> What am I missing ?
>
> The code is like this :
>
>
> pfGeoSet* cylGeoSet = new(arena) pfGeoSet;
>
> cylGeoSet->setAttr(PFGS_COORD3, PFGS_PER_VERTEX, cylPts, indexPts);
> cylGeoSet->setAttr(PFGS_NORMAL3, PFGS_PER_PRIM, cylNormals, indexNormals);
> cylGeoSet->setAttr(PFGS_COLOR4, PFGS_PER_VERTEX, cylColors, indexColors);
> cylGeoSet->setAttr(PFGS_TEXCOORD2, PFGS_OFF, cylPts, indexPts);
>
> // the total number of triangles
> cylGeoSet->setNumPrims(2*(nbPtsHeight-1)*2*nbPtsCircle);
> cylGeoSet->setPrimType(PFGS_TRIS);
>
> // set the pfGeoState and the pfGeoSet
> gstate = new(arena) pfGeoState;
> gstate->setMode(PFSTATE_CULLFACE, PFCF_OFF);

> gstate->setMode(PFSTATE_ENLIGHTING, PFTR_OFF);

        gstate->setMode(PFSTATE_ENLIGHTING, PFTR_ON);

> gstate->setMode(PFSTATE_TRANSPARENCY, PFTR_OFF);
> gstate->setMode(PFSTATE_ENTEXTURE, PFTR_OFF);
> gstate->setMode(PFSTATE_ENHIGHLIGHTING,PFTR_OFF);
> gstate->setMode(PFSTATE_ENWIREFRAME, PFTR_OFF);
>
> cylGeoSet->setGState(gstate);
>
> Thanks for help !
>
> Yann
>
> PS : I've an other object in the scene (that is create form a file and is
> textured) and it uses the light.
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> [][][] [][] [][][] [] > 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

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


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:46 PDT

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