problem with normals

New Message Reply Date view Thread view Subject view Author view

Yann Andenmatten (andenmat++at++imtsg12.epfl.ch)
Thu, 27 Feb 1997 09:01:24 +0100


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

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

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