Polygons in Performer 2.0

New Message Reply Date view Thread view Subject view Author view

Daniela Rainer (zrgr0390++at++visvr1.rus.uni-stuttgart.de)
Mon, 15 Jan 1996 14:37:01 +0000


Hi,

I have a question about polygons in Performer 2.0:

The direction of the normals of the (GL ?) triangles, that make the
(Performer) polygon are wrong.

For example if I define a rectangle

          .........

  static pfVec3 coordArray[4] = {
                                {0.0f, 0.0f, 0.0f},
                                 {1.0f, 0.0f, 0.0f},
                                {1.0f, 0.0f, 0.5f},
                                {0.0f, 0.0f, 0.5f}};

  static pfVec4 colorArray[4] = {
                                {1.0f, 0.0f, 0.0f, 1.0f},
                                  {1.0f, 0.0f, 0.0f, 1.0f},
                                {1.0f, 0.5f, 0.0f, 1.0f},
                                {0.0f, 0.5f, 0.0f,1.0f}};

  static int primLenghthsArray[1]={4};

  static pfVec3 normalArray[4]={{0.0f, -1.0f, 0.0f},
                                {0.0f, -1.0f, 0.0f},
                                {0.0f, -1.0f, 0.0f},
                                {0.0f, -1.0f, 0.0f}};

        .........

  geoset = pfNewGSet(NULL);

  pfGSetAttr(geoset,PFGS_COORD3, PFGS_PER_VERTEX, coordArray, NULL);
  pfGSetAttr(geoset, PFGS_COLOR4, PFGS_PER_VERTEX, colorArray, NULL);
  pfGSetAttr(geoset, PFGS_NORMAL3, PFGS_PER_VERTEX, normalArray, NULL);
  pfGSetPrimType(geoset,PFGS_POLYS);

  pfGSetNumPrims(geoset, 1);
  pfGSetPrimLengths(geoset, primLenghthsArray);

        .........

  one triangle has the correct normals (0.0f, -1.0f, 0.0f) but the other one
has
  (0.0f, 1.0f, 0.0f), so I can't see the whole rectangle but only one triangle.
  In wireframe mode I see the correct rectangle.

  ----------- .
| | . |
| | . |
| | . |
| | . |
  ----------- ----------

  wireframe mode filled polygon

 Does anybody know what I am doing wrong here?

 Daniela

-- 
Daniela Rainer
rainer++at++rus.uni-stuttgart.de

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:52:15 PDT

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