Material tables with .flt loader

New Message Reply Date view Thread view Subject view Author view

Eric S. Hirschorn (erich++at++pike.cecer.army.mil)
Wed, 9 Aug 1995 15:25:55 -0500 (CDT)


Hi,

I've been playing around with changing material properties of various
objects from within Performer. My method is to:

1) Read in an object file with LoadFile, i.e.
        root = LoadFile(DatabaseFiles[i], NULL);

2) Traverse root and search out the geode pointers, using a modified form of
pfuTraverse.

3) Grab pointers to pfMaterials from a *pfGeode , i.e.

        mtl = pfNewMtl(NULL);
        mtl = pfGetGStateAttr(pfGetGSetGState(pfGetGSet(pgeode, 0)), PFSTATE_FRONTMTL);

4) Modify mtl, and then place it back into the *pfGeode:

            pfMtlColor(mtl, PFMTL_EMISSION, 1.0f, 0.0f, 0.0f);
            pfGStateAttr(pfGetGSetGState(pfGetGSet(pgeode, 0)), PFSTATE_FRONTMTL, mtl);

This method has worked well when working with Inventor objects loaded into
Performer. However, I found that this does not work with OpenFlight format
objects. The problem is that every object loaded with LoadFlt acquires
the changed material properties. In the above case, all .flt objects start
to glow red, when I only wanted one of them to.

When I looked at the LoadFlt documentation, I found the following
statement:

"-the converter assumes that all .flt files use the same material table"

Aside from the obvious question of why the loader makes this assumption,
can anyone give me a hint on how to work around this problem?

Eric
_____________________________________________________________________________
Eric S. Hirschorn, VE Group, USACERL, Champaign IL 61826-9005
TEL: 1 (800) USA-CERL ext. 6363 FAX: (217) 373-6724
email: erich++at++pike.cecer.army.mil, http://pike.cecer.army.mil/erich/erich.html


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:46 PDT

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