pfdBuilder and indexed polygons

New Message Reply Date view Thread view Subject view Author view

From: David Geldreich (David.Geldreich++at++sophia.inria.fr)
Date: 12/13/2001 09:31:10


    Hello pfers,

    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

    Thanks in advance for your help

--------------------
#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);

    pfdDelGeom(geom);

    pfNode *node = pfdBuild();

    pfdStoreFile(node, "toto.pfb");

    pfdExitBldr();
}


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Dec 13 2001 - 09:30:57 PST

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