lai++at++daimi.au.dk
Date: 07/01/2004 05:08:51
Hi!
I have a transparent plane (keyhole), which I always want drawn in front of the
other geometry. Even other transparent objects. However, I have the problem,
that all other transparent object are drawn "in front" of the plane.
Inspired by the mailing list archives, I have tried two different solutions.
The first solution was to use drawbins.
First I create a free bin, like this:
pfPipe * pipe = pfGetPipe(0);
pfChannel * channel = pipe->getChan(0);
freeBin = channel->getFreeBin();
channel->setBinSort(freeBin, PFSORT_NO_SORT, NULL);
keyhole->gSet->setDrawBin(freeBin);
However in the drawcallback, if I only call
pfDrawBin(PFSORT_DEFAULT_BIN);
pfDrawBin(PFSORT_OPAQUE_BIN);
pfDrawBin(PFSORT_TRANSP_BIN);
then the keyhole still gets drawn, even though I never call
pfDrawBin(freeBin)...
The second solution was to make the bounding box of the keyhole extremely large
in one direction. Something like this:
pfBox * nBound = new pfBox;
keyhole->gSet->getBound(nBound);
float dist = 1000000;
nBound->min[1]-=dist;
keyhole->gSet->setBound(nBound,PFBOUND_STATIC);
The keyhole is added to the scene later during runtime, which should ensure a
recalculation of the rest of bounding boxes on the way to the top of the scene
graph...
Also the keyhole is the last node in the scene graph.
I hope someone can help...
Regards
Gorm
This archive was generated by hypermail 2b29 : Thu Jul 01 2004 - 05:09:56 PDT