Re: Can I specify drawing order?

New Message Reply Date view Thread view Subject view Author view

Lawrence Bertoldi (lberto++at++sgi.com)
Tue, 27 Apr 1999 16:14:27 -0400


I guess I should have been more clear on what I was suggesting you Try!
Basically what Gordon says is true. You are turning off the sorting
for EVERYTHING. That way YOU control the sorting completely by the Order
objects are placed into the scene. In the example I gave that was my
intent. I
found that sometimes to get predictable results you have to break a few
rules, become a control freak and manipulate things yourself.

So I guess the question is, Do you want to Control Render Order yourself
Or Do you just want to insure that some object is drawn last?

If what you want is to control render order yourself, give my
suggestion a try!! It couldn't hurt! It's quick, easly undone And
you could learn something new!!

Gordon Tomlinson wrote:
>
> Hi
>
> 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 ..
>

This only allows you to control the order of things in the new bin!
Things in OPAQUE bin are still drawn first, things in TRANSP bin are
drawn second then the new bin is drawn.

>> 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 )
> ______________________________________________________________
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

-- 
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

~;-}>


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Apr 27 1999 - 13:30:46 PDT

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