Shading

New Message Reply Date view Thread view Subject view Author view

From: Markus Som (markussom++at++gmx.at)
Date: 10/24/2000 03:09:52


Hi! I've some problems with Performer.
I try to make a Geoset with a color for each prim, i set the normals and
the smooth shading on. But the smooth shading does not work!

What am i doing wrong. Does anyone have a short example ia to draw to
polygons with this smooth shading?

Second Question. Is there any standard function to calculate the normats
if i have the vertex!

thanks
markus

Here a code fragment:

        gset->setPrimType(PFGS_POLYS);
...
        gset->setPrimLengths(lengths);

        verts = (pfVec3 *) pfMalloc(vertscnt* sizeof(pfVec3),
pfGetSharedArena());
        norms = (pfVec3 *) pfMalloc(vertscnt* sizeof(pfVec3),
pfGetSharedArena());
         color = (pfVec4 *) pfMalloc(vertscnt* sizeof(pfVec4),
pfGetSharedArena());
        ...
        verts[n]=...
        norms[n]=...
        color[n]=...
        ...
        gset->setAttr(PFGS_COORD3, PFGS_PER_VERTEX, verts, NULL);
        gset->setAttr(PFGS_NORMAL3, PFGS_PER_VERTEX, norms, NULL);
        gset->setAttr(PFGS_COLOR4, PFGS_PER_VERTEX, color, NULL);
        
        gstate= new pfGeoState;
        gstate->setMode(PFSTATE_SHADEMODEL,PFSM_GOURAUD);

        gset->setGState(gstate);

-- 
Sent through GMX FreeMail - http://www.gmx.net


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Oct 24 2000 - 03:10:07 PDT

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