[info-performer] OpenFlight loader, pfFlux, and the getNumGSets()

Date view Thread view Subject view Author view

From: faculaganymede (faculaganymede++at++yahoo.com)
Date: 11/26/2003 18:43:05


Hi All,

I have a question that involves the OpenFlight loader,
pfFlux, and the getNumGSets() function.
I am trying to traverse the pfNode of the Performer
esprit.flt model and flux its surface colors.

1) When I do geode->getNumGSets() in my
igTraverseNode() function (pls see below), it returns
1, is this correct? The esprit car has only one
geoset?

2) I call my igFluxModelColors() function (pls see
below) to change the flux color in every frame but the
esprit car stays BLACK (the initial flux color). Why?

3) I read in the mailing-list archive (back in 1998,
http://oss.sgi.com/projects/performer/mail/info-performer/perf-98-11/0131.html),
someone posted a message saying that the OpenFlight
loader "couldn't track the geometry in the geosets"
and "that the flt-loader does not translate
flt-morph-nodes into pfEngine and pfFlux." Has this
been changed since?

        ...

modelNode = pfdLoadFile("esprit.flt");
igTraverseNode(modelNode);

        ...

static void igTraverseNode(pfNode *node)
{
        int i;
        pfGeode *geode;
        pfGeoSet *gset;
    pfVec4 *colors;
    unsigned short *ilist;

        flux_colors = new pfFlux(sizeof(pfVec4),
PFFLUX_DEFAULT_NUM_BUFFERS);

        if(node->isOfType(pfGeode::getClassType()))
        {
                geode = (pfGeode *) node;
                
                for(i=0; i<geode->getNumGSets(); i++)
                {
                        gset=geode->getGSet(i);

                        gset->getAttrLists(PFGS_COLOR4, (void **)&colors,
&ilist);
                        
                        if(colors)
                                gset->setAttr(PFGS_COLOR4, PFGS_OVERALL,
flux_colors, ilist);
                }
        }

        else if(node->isOfType(pfGroup::getClassType()))
        {
                pfGroup *group=(pfGroup *) node;
                for(i=0; i<group->getNumChildren(); i++)
                {
                        igTraverseNode(group->getChild(i));
                }
        }
}

        ...

static void igFluxModelColors(void)
{
    pfVec4 *colors;
        float t=pfGetTime();

    colors = (pfVec4 *)flux_colors->getWritableData();

        colors->set( 0.2*t, 0.5, 0.1*t, 1.0f);

    flux_colors->writeComplete();
}

        ...

=====
Thanks,
faculaganymede

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Nov 26 2003 - 18:52:33 PST