Re: intersection at polygon vertices

New Message Reply Date view Thread view Subject view Author view

Steve Baker (sbaker++at++link.com)
Mon, 8 Dec 1997 06:58:58 -0600 (CST)


On Fri, 5 Dec 1997, Mario Veraart wrote:

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

>>>>> 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.
>>
>> 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.
>
> The database I build to test is not a typical one used for the real
> thing. Only to get a simple version. The real terrain is 60x60km, tiled.
> In the real database all orientations and cooridinates are possible.
> It might be possible that for some polygon I have to do the test that
> all vertices are alligned with ground vertices and that the test will
> fail.
  
This is that same situation that I have in my application, I don't see
any problems of this kind - but as you say, the probability of the
test vector going through a vertex is very small.

>> 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.
>
> If the database is modelled with a continuous ground plane it doesn't
> care for witch of the primitives there is a hit. They will all result
> in the same hit point (the common vertex).

Right - and I think Performer *should* get that right. If you have a clear
example where that is NOT the case (which seems to be true for the
situation you picture above), then you should send it to the Performer
team to see if they can find what the problem is.

> In this simple model I suspected to get a hit, for one of the quads.
> It misses the ground plane primitives but intersects with one above the
> ground plane, with a vertex matching the segments XY coordinate.
> But if I test the intersection along an edge of the quads I get a hit.
> And a vertex is part of the edge, isn't it?
  
I suspect that is simply a matter of luck - after all, if we really
suspect a roundoff error (I certainly do), then it's very hard to
predict what will happen for any specific circumstance.

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

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