PFGS_POLYS in Performer 2.0

New Message Reply Date view Thread view Subject view Author view

Rejean Chartrand (rejeanc++at++cae.ca)
Fri, 2 Feb 1996 14:56:47 -0500


On Jan 15, 2:37pm, Daniela Rainer wrote:
> Subject: Polygons in Performer 2.0
> 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
>-- End of excerpt from Daniela Rainer

and

On Jan 15, 11:44am, Rejean Chartrand wrote:
> Subject: RE: RE: Polygons in Performer 2.0
> I understand the concept of backfacing but the problem in this case is not
> that.
>
> If backfacing was the problem, then the polygon would be either totally
> displayed or not displayed at all but not half of it. By looking at the way
> the vertices are enumerated, the true normal of the polygon shall in fact be
> {0.0, -1.0, 0.0}. But the problem seem to be that polygons in Performer 2.0
> (which is a new primitive) are displayed as triangles but it seem that the
> normal is flipped from one polygon to the other.
>
> Any idea how to solve that ? (Maybe by not using the PFGS_POLYS primitive)
>
> And what appends if the polygon is concave (which is not the case here), will
> it be drawn correctly ?
>-- End of excerpt from Rejean Chartrand

I am a bit surprised that nobody from the Performer Developpers group have not
answered that question because to me I consider it as one. Does it really
mean that PFGS_POLYS are unusable in Performer 2.0 or what ?

I would like somebody from SGI to comment on that.

Thanks in advance !

Rejean Chartrand.
CAE Electronics Ltd.

e-mail : rejeanc++at++cae.ca


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

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