POV-Ray : Newsgroups : povray.unofficial.patches : Hey, Warp (Tesselation patch: the fire test) : Re: Hey, Warp (Tesselation patch: the fire test) Server Time
6 Oct 2024 12:28:56 EDT (-0400)
  Re: Hey, Warp (Tesselation patch: the fire test)  
From: Warp
Date: 8 Oct 2001 13:01:35
Message: <3bc1dbef@news.povray.org>

:     As Warp is the author of the patch, he is the one to choose.

  I have an idea. It will probably make the tesselating slower, but if it
works, it works.

  As you say, the problem is probably in the insideness test, which can
differ slightly from what the intersection test does. Thus, we should just
get rid of the insideness test completely. (Of course as the main purpose of
the insideness test is speed, we will lose this seedup, but it seems that it's
out of question.)

  So we should do it solely with the intersection calculation. But how?
  As we know, POV-Ray doesn't start the intersection calculation from the
starting point of the ray but moves a small amount forward before actually
shooting the ray (this is necessary for many things, such as reflection,
refraction etc. where the starting point of the ray is exactly on the surface
of an object).
  I don't like the idea of moving the starting point back a bit before making
the intersection test because it can give a wrong result (it can intersect
the surface even though the tetrahedron is not intersecting it).

  However, I have another idea: Move the starting point back a considerable
amount (not a huge step, but more than just a tiny fraction; something like
0.1 units or whatever) and then get *ALL* the intersections of the ray and
the object. After this look if any of these intersection points is between
the real start and end points. If there is any, take it.
  Of course there could be more than one point between the start and end
points, but that's an accuracy thing. We take just one of them (it doesn't
really matter which).
  The advantage of this is that you don't miss points by accident (because
of the inside vs. intersection problem) and you get an accurate result (only
points which are truely at the edges of the tetrahedron are taken, not points
outside it).

  Yes, this is slow, I know. But if it works, it works...

  I have to test this when I got the time...

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.