Problem with scaling with Intersections

New Message Reply Date view Thread view Subject view Author view

Kim Michael Fairchild (fair++at++iss.nus.sg)
Thu, 19 May 94 19:19:59+080


Hello,

I have found that reported intersections don't seem to pay any
attention to scale.

For instance if I load the "canyon.flt" file and run a version of the
following code,

  segset.segs[0].length = 1000.0f;
  pfSetVec3(segset.segs[0].dir, 0.0f, 0.0f, -1.0f);
  segset.isectMask = intersectionMask;
  pfSetVec3(segset.segs[0].pos, vector[0], vector[1], vector[2]);

  isect = pfSegsIsectNode(ViewState->scene, &segset, hits);

I get a depth of about 300 meters when looking over the canyon. But when
I scale "canyon.flt" (e.g. by .1), I still get 300 meters for the
depth of the canyon. It is of course possible that I could save the
scale factor and multiple it by what ever I get from pfSegsIsectNode
to get the correct value but this seems quite clumsy.

Since I could have multiple scale factors, I would then have to
traverse up the parent hierarchy looking for DCS or SCS type objects
and if finding them collect a cumulative multiplication to get the
scale. Alternative, I could of pre-collected the scale factors and
bind it to the top-level group but this still doesn't seem very
elegant.

So, am I doing something wrong? In our applications, we typically will
scale something by 1000 or by .001 (since we have to convert stuff
from all sorts of formats). The default xformer collision detection
gets confused as well (although works reasonably well for smaller
scaling factors).

thanks, Kim.


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:16 PDT

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