Gordon Tomlinson (gordon++at++paradigmsim.com)
Fri, 23 Apr 1999 16:47:58 -0500
Be careful when playing with the 2 default bins
especially if you set the bin Order to -1
This means that any Geosets placed there get drawn in the order
that they are place in the bin and can effect transparency
a bin order of -1 has NO sort order and cannot be sorted.
chan->setBinOrder(PFSORT_OPAQUE_BIN,-1);
chan->setBinOrder(PFSORT_TRANSP_BIN,-1);
You should leave these bins as they are and create bins
for the geometry that you wish control the draw order
and set the sort bin "pfChanBinSort" to "PFSORT_DRAW_ORDER"
on the new bin, if you want it drawn after then give the
"pfChanBinOrder" a number greater than 2 and set the bin
on the Geoset with "pfGSetDrawBin" and then use
"pfGSetDrawOrder" to set the draw order of the Geoset 0
being drawn first etc ..
Lawrence Bertoldi wrote:
>
> since your using C++ you should look at the man page for
> pfChannel and pfGeoSet and not get wrapped up in the
> c/c++ syntax differences.
>
> Most of what you need is in here.
>
> Try this
>
> // Turn off bin ordering for OPAQUE and TRANSP bins
> // (these are the default bins)
>
> chan->setBinOrder(PFSORT_OPAQUE_BIN,-1);
> chan->setBinOrder(PFSORT_TRANSP_BIN,-1);
>
> turn off binsorting within the bins
>
> chan->setBinSort(PFSORT_TRANSP_BIN, PFSORT_NO_SORT, NULL);
> chan->setBinSort(PFSORT_OPAQUE_BIN, PFSORT_NO_SORT, NULL);
>
> //First Create the objects....
>
> pfGeode *geode[3];
> for(int i = 0; i < 3; i++)
> {
> geode[i] = new pfGeode;
> geode[i]->ref();
> }
>
> //Load them into the scene graph the way you want them to be drawn
> //This way the objects get sorted by there position in the scene graph.
>
> scene->addChild(geode[2]);
> scene->addChild(geode[1]);
> scene->addChild(geode[0]);
>
> //to change the sorting order,
>
> scene->removeChild(geode[0]);
> scene->insertChild(index,geode[0]);
>
> I just happen to have done something vary much like this
> within the last month.
>
> --
> See Ya,
>
> Lawrence Eugene Bertoldi Technical Consultant
> vnet 238-8949 Silicon Graphics
> phone 301-572-8949 Silver Spring MD.
> email lberto++at++clubfed.sgi.com
>
> ~;-}>
>
> Gordon Tomlinson wrote:
> >
> > Hi
> >
> > To control the Draw order you need to use
> >
> > pfDrawBins, you create these for your channels
> > then tell you pfGeoSets which bin they belong in
> > and you can sort these bins etc
> >
> > Have a look at
> >
> > pfGetChanFreeBin(pfChannel* chan)
> > pfChanBinSort(pfChannel *chan, int bin, int sortType,int *sortOrders);
> > pfChanBinOrder(pfChannel *chan, int bin, int order);
> > pfDrawBin(int bin);
> >
> > pfGSetDrawBin(pfGeoSet *gset, short bin);
> > pfGSetDrawOrder(pfGeoSet * gset, unsigned int order);
> >
> > These should point you in the right direction
> >
> > Gordon.
> >
> > > Choi, Changrak wrote:
> > >
> >
> > > Dear performers.
> > >
> > > I want to specify drawing order at pf level.
> > > For example,
> > > I make 3 geodes and attach them to scene graph.
> > >
> > > pfGeode *geode[3];
> > > pfScene *scene = new pfScene;
> > >
> > > for(int i = 0; i < 3; i++)
> > > {
> > > geode[i] = new pfGeode;
> > > .... // add GSet etc
> > > scene->addChild(geode[i]);
> > > }
> > >
> > > In this case, all geode drawing orders depend on distances from eye point to geodes' bounding box.
> > > When I want that always geode[0] draws last time, how can I program?
> > >
> > > Sorry to short English,
> > >
> > > Thanks..
> > >
> > > -----------------------------------------------------
> > > ÃÖâ¶ô (Choi, Changrak)
> > > http://galaxy.channeli.net/maitte/
> > > ¼¿ï½Ã ¿µµîÆ÷±¸ ¿©Àǵµµ¿ 18 Çѱ¹¹æ¼Û°ø»ç
> >
> > --
> >
> > Regards
> >
> > Gordon.
> >
> > Gordon Tomlinson | Multigen - Paradigm Inc
> > Vega Software Engineer | Suite 400, 14900 Landmark Blvd
> > Email: gordon++at++paradigmsim.com | Dallas, Texas 75240, USA
> > Tel: 972 960 2301 | Fax: 972 960 2303
> > ______________________________________________________________
> >
> > 'Smoke me a kipper skipper, I'll be back for breakfast'
> > ______________________________________________________________
> >
> > 640K of ram should enough for anybody. Bill Gates 1981
> >
> > There is no reason anyone would want a computer in their home
> > (Ken Olson, president of Digital Equip Corp 1977 )
> > ______________________________________________________________
> > -----------------------------------------------------------------------
> > List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> > Submissions: info-performer++at++sgi.com
> > Admin. requests: info-performer-request++at++sgi.com
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
--
Regards
Gordon.
Gordon Tomlinson | Multigen - Paradigm Inc Vega Software Engineer | Suite 400, 14900 Landmark Blvd Email: gordon++at++paradigmsim.com | Dallas, Texas 75240, USA Tel: 972 960 2301 | Fax: 972 960 2303 ______________________________________________________________
'Smoke me a kipper skipper, I'll be back for breakfast' ______________________________________________________________
640K of ram should enough for anybody. Bill Gates 1981
There is no reason anyone would want a computer in their home (Ken Olson, president of Digital Equip Corp 1977 ) ______________________________________________________________
This archive was generated by hypermail 2.0b2 on Fri Apr 23 1999 - 14:43:06 PDT