Re: Multiple presentation of the same geometry in different channels.

New Message Reply Date view Thread view Subject view Author view

Allan Schaffer (allan++at++southpark.engr.sgi.com)
Sun, 26 Jul 1998 16:41:19 -0700 (PDT)


On Jul 21, 1:49pm, Oyvind Roa wrote:
> I am currently working on a tank (German LEO) simulator,
> where we have geospesific terrain. Our database supplier
> (third part) has delivered the database in 4 versions :
> Summer, Summer IR, Winter and Winter IR. All the geometry
> are equal in the database versions, the only difference is in
> the geostates (textures and for IR also the materials). The tank
> simulator cabins have approx. 20 different channels defined, and
> one of them simulates an IR (InfraRed) monitor.
>
> To me it seems stupid to load the geometry twice (which I currently
> have to do) to be able to view the same terrain just with a different
> presentation (geostates) in one or more of the channels.

Yep, these problems are what indexed geostate's were made for.
Rather than directly specifying a particular geostate for a given
geoset, you can instead bind to an index in a list of geostates, and
then just change the list for each channel.

Check out the routines pfChannel::setGStateTable (or pfChanGStateTable),
pfGeoSet::setGStateIndex (or pfGSetGStateIndex), etc:

pfChannel::setGStateTable..
     sets the pfChannel's pfGeoState table to gstable. If non-NULL,
     gstable is made the global pfGeoState table with
     pfGeoState::applyTable before the pfChannel's DRAW callback is
     invoked. Any indexed pfGeoStates, either referenced by a
     pfScene (- pfScene::setGStateIndex) or by scene pfGeoSets
     (pfGeoSet::setGStateIndex) will be accessed through gstable.
     Indexed pfGeoStates are useful for efficiently managing a single
     database with multiple appearances, e.g., a normal vs. an
     infrared view of a scene would utilize 2 pfGeoState tables, each
     referencing a different set of pfGeoStates.

pfGeoSet::setGStateIndex...
     A pfGeoSet may either directly reference or indirectly index a
     pfGeoState with pfGeoSet::setGState and pfGeoSet::setGStateIndex
     respectively. Indexed pfGeoStates use a global table of
     pfGeoState pointers that is set by pfGeoState::applyTable. If
     the global table is NULL or the pfGeoState index is out of the
     range of the global table, no pfGeoState is applied, otherwise
     the indexed pfGeoState is applied when pfGeoSet::draw is called.
     Non-indexed pfGeoState references ignore the current pfGeoState
     table. pfGetCurGStateTable returns the current pfGeoState table
     and pfGetCurIndexedGState returns the indexth pfGeoState* in the
     current pfGeoState table or NULL if the index cannot be properly
     resolved.

Allan

-- 
Allan Schaffer                                                allan++at++sgi.com
Silicon Graphics                               http://reality.sgi.com/allan
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

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:57:43 PDT

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