Re: pfdBuilder and indexed polygons

New Message Reply Date view Thread view Subject view Author view

From: Yair Kurzion (yair++at++polygon.engr.sgi.com)
Date: 12/13/2001 15:20:46


Hello There !

> I would like to build indexed polygons and there is not a lot of
> examples with Performer and the man pages to find how to do it.
>
> I dont find what I am doing incorrectly. Evant after a quick look at
> /usr/share/Performer/src/lib/libpfdu/pfdGeoBuilder.c

In your code below, use pfdAddIndexedBldrGeom instead of pfdAddBldrGeom.

-yair

> --------------------
> #include <Performer/pf.h>
> #include <Performer/pfdu.h>
>
> #include <Performer/pf/pfGroup.h>
> #include <Performer/pf/pfGeode.h>
> #include <Performer/pr/pfGeoSet.h>
>
>
> int main()
> {
> pfInit();
> pfdInitBldr();
>
> pfdInitConverter("toto.pfb");
>
> pfConfig();
>
> pfVec3 coordList[4];
> coordList[0].set(-1.f,-1.f,0.f);
> coordList[1].set(1.f,-1.f,0.f);
> coordList[2].set(1.f,1.f,0.f);
> coordList[3].set(-1.f,1.f,0.f);
>
> pfdGeom *geom = pfdNewGeom(4);
>
> geom->flags = PFD_INDEXED;
> geom->coordList = coordList;
> geom->nbind = PFGS_OFF;
> for(int cb = 0 ;cb < PF_MAX_TEXTURES; cb++)
> geom->tbind[cb] = PFGS_OFF;
> geom->cbind = PFGS_OFF;
> geom->primtype = PFGS_POLYS;
> geom->numVerts = 4;
>
> geom->icoords[0] = 0;
> geom->icoords[1] = 1;
> geom->icoords[2] = 2;
> geom->icoords[3] = 3;
>
> pfdAddBldrGeom(geom, 1);

      ^^^^^ Should be pfdAddIndexedBldrGeom(geom, 1);

>
> pfdDelGeom(geom);
>
> pfNode *node = pfdBuild();
>
> pfdStoreFile(node, "toto.pfb");
>
> pfdExitBldr();
> }
> -----------------------------------------------------------------------
> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
> -----------------------------------------------------------------------
>

-- 
\_________  \_____  \__    \__  \_____        
\_________  \_____   \__   \__  \_____         Yair Kurzion
       \__     \__   \____\__      \__         yair++at++sgi.com
       \__          \__  \__                  (650) 933-6502
       \__          \__   \__          
       \__          \__    \__             


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Dec 13 2001 - 15:20:56 PST

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