Christopher James Huff wrote:
>Pseudocode:
>
>if true-normal faces toward ray
> (ray origin is on outside)
>
> if interpolated-normal faces away from ray
> skip intersection
> (it shouldn't be visible anyway)
>
> set flag to skip next
> (it is part of the interior visible through
> the skipped intersection)
> end
>else
> (ray origin is on inside, flip the normal
> directions and do the same thing as above)
>end
I am willing to try and modify my patch to support this concept.
There is a some small technical problem that needs to be solved though:
There is no ordering in the set of triangles of the mesh till all the
intersections are calculated.
So my implementation will be something like:
In test_hit:
if smooth
{calc}
if true normal faces towards ray
flip directions of extra normals
end
{calc}
if inverted
register call but with invalid mark
else
current registering call
end
else
current registering call
end
In the function that determines the frontmost intersections:
extra loop:
Invalid=false
do
if Invalid
{calculate the front intersection}
remove intersection from list
{calculate the front intersection}
Invalid=false
else
{calculate the front intersection}
endif
if marked
remove intersection from list
Invalid=true
end
while not Invalid
This way there is not much overhead when there are no triangles skipped.
But this routine can handle the situation where 4 triangles (2 times 2) need
to be skipped.
Post a reply to this message
|