Re: intersection.....

New Message Reply Date view Thread view Subject view Author view

Jim Helman (jimh++at++surreal)
Tue, 24 Jan 95 15:57:16 -0800


> I have exactly the same intersection definition, but one uses :
> PFTRAV_IS_PRIM|PFTRAV_IS_CULL_BACK for the mode, and the other one
> PFTRAV_IS_GEODE|PFTRAV_IS_CULL_BACK. When I do a query about the
> transformation matrix (pfQueryHit(hits[0][0], PFQHIT_XFORM,
> xform)), I actually get it when intersecting at the primitive
> level, but I don't at the geode level -> any idea?

A bug. For bounding sphere intersections (PFTRAV_IS_GEODE), the
transformation wasn't being copied into the final pfHit structure
after return from the discriminator. I just fixed it for 2.0. A
workaround is to use a discriminator callback and manually set the
PFHIT_XFORM bit in the flags field of the pfHit structure, i.e.
in the discriminator callback:

        #if (PF_MAJOR_VERSION == 1)
        int
        mydiscrim(pfHit *hit)
        {
             ((long *)hit)[4] |= PFHIT_XFORM;
             return PFTRAV_CONT;
        }
        #endif

Be sure to #ifdef the code because bad things will happen
when if you try this with 2.0.

-jim
         


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:53 PDT

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