Re: Shading

New Message Reply Date view Thread view Subject view Author view

From: Angus Dorbie (dorbie++at++sgi.com)
Date: 10/24/2000 14:55:47


There is one other thing you need. I assume you have lighting because
you have surface normals so the pfMaterial used needs to specify which
material attribute the color calls affect.

Use ::setColorMode to specify which of the material attributes the
geoset color attributes map to.

Cheers,Angus.

Markus Som wrote:
>
> 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
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

-- 
For Performer+OpenGL tutorials http://www.dorbie.com/

"In the middle of difficulty lies opportunity." --Albert Einstein


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Oct 24 2000 - 14:56:05 PDT

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