Re: intersection at polygon vertices

New Message Reply Date view Thread view Subject view Author view

Steve Baker (sbaker++at++link.com)
Fri, 5 Dec 1997 10:17:10 -0600 (CST)


On Fri, 5 Dec 1997, Mario Veraart wrote:

> > > I have found a small misfunctioning for the pfNode::isect() method.
> > > If I create a simple database consisting of 4 quads at z=0.

> > > I want to try to intersect with the following segment
> > > origin = (40,0,-100)
> > > direction = (0,0,-1)
> > > length = 200
> >
> > OK, so the segment starts at Z=-100 and ends at Z=-100+200*(-1)=-300.
>
> Sorry a small typo from my side.
> In the code the direction was set to (0,0,1)

Ah! It makes more sense now!
  
> > > My question:
> > > Is there a possibility that intersection at an xy coordinate that matches a
> > > vertex coordinate is missed for some of the vertices in a quad or
> > > triangle? (It does not happen along the edge of a primitive)
> >
> > I suppose a teeny-tiny roundoff error could result in a miss - it's not
> > totally unreasonable.
>
> If this is the case than I have to try and find a way round this
> problem. That is because I have to intersect at vertex coordinates of
> some primitives that are part of the database.

I'd say that relying on an infinitely thin segment hitting an
infinitely small point is inviting roundoff problems. You
might get away with it when everything is nicely aligned along
the axes - but as soon as you get into arbitary orientations,
you should certainly not expect it to work.

However, in the case you show here....

> > > The database is a Multigen Flight file.
> > >
> > > Y=
> > > 40------------------- Z=0
> > > | | |
> > > | | |
> > > | | |
> > > | | |
> > > 0|--------|--------|
> > > | | |
> > > | | |
> > > | | |
> > > | | |
> > > -40-------------------
> > > 0 40 80 X=
  
...when you fire a ray at the exact center of the diagram,
(starting at a point that is cleanly on one side of it and
ending at a point that is cleanly on the other side of it) then
I think it is reasonable to expect Performer to guarantee
that you do hit at least ONE of the four quadrilaterals -
although I think it is reasonable that it would not guarantee
to generate hits on all four polygons (as you seem to imagine
it would) - or to guarantee *which* of the four it would hit.

IMHO, it would be nice if Performer simply guaranteed to hit
exactly one of the polygons in this case.

However, if Performer were to miss all four polygons (which is
what you seem to be saying) then that would be a DISASTEROUS
situation for many applications - and should be regarded as a
serious bug.

Having said that, I don't think I have ever seen that situation
happen in practice in my applications.

If your segment were to start or end *exactly* on the plane,
then I think Performer would also be behaving reasonably if
it didn't define whether you would get a hit or a miss in that
situation. Once again, roundoff error would make that hard to
guarantee.

Steve Baker 817-619-8776 (Vox/Vox-Mail)
Hughes Training Inc. 817-619-4028 (Fax)
2200 Arlington Downs Road SBaker++at++link.com (eMail)
Arlington, Texas. TX 76005-6171 SJBaker1++at++airmail.net (Personal eMail)
http://www.hti.com http://web2.airmail.net/sjbaker1 (personal)

** Beware of Geeks bearing GIF's. **

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


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:56:20 PDT

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