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

-----------------------------------------------------------------------
   List Archives, Info, FAQ: http://www.sgi.com/software/performer/
   Open Development Project: http://oss.sgi.com/projects/performer/
                Submissions: info-performer++at++sgi.com
            Admin. requests: info-performer-request++at++sgi.com
-----------------------------------------------------------------------


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Apr 07 2005 - 00:00:52 PDT