Re: Can I specify drawing order?

New Message Reply Date view Thread view Subject view Author view

Lawrence Bertoldi (lberto++at++sgi.com)
Fri, 23 Apr 1999 16:51:15 -0400


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


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Fri Apr 23 1999 - 14:02:51 PDT

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