[info-performer] pfPolytope based visibility check

Date view Thread view Subject view Author view

From: Arend Abbing (a.abbing++at++marin.nl)
Date: 04/06/2005 08:09:10


Hi,

I'm trying to implement a pfPolytope based visibility check of geometry
fitting exactly in a pre-calculated pfPolytope (m_polytope) but its
doesn't work (it culls the sector always). Has anyone a clue of what's
going wrong here?

int Sector::app(pfTraverser *trav)
{
        if (ptope) {
                pfVec3 eye;
                pfMatrix mat, trans;
                static pfPolytope *poly = 0L;
                static pfPolytope *view = 0L;
        
                if (!poly) {
                        poly = new (pfGetSharedArena()) pfPolytope(6);
                        view = new (pfGetSharedArena()) pfPolytope;
                }

                // Transform the polytope from object space to viewing
                // space.
                trav->getMat(mat);
                pfChannel *channel = trav->getChan();
                poly->orthoXform(this->m_polytope, mat);

                // Get the current viewing frustum polytope and check
                // the intersection
                channel->getPtope(view);
                m_visible = view->contains(poly);
        }
        return pfGroup::app(trav);
}

Regards,

Arend.


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Apr 06 2005 - 08:09:27 PDT