POV-Ray : Newsgroups : povray.newusers : Scaling question... Server Time
30 Jul 2024 22:24:02 EDT (-0400)
  Scaling question... (Message 21 to 22 of 22)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Carl Hoff
Subject: Re: Scaling question...
Date: 29 Nov 2003 10:46:00
Message: <3fc8bf38@news.povray.org>
> Well, one easy way to do what you want is to make several hundred
> ellipsoids spread along the axis of your shape, linearly changing from
> one shape to the next. This takes quite a few spheres to make a smooth
> shape, and has some obvious inefficiencies, but is quite feasible...in
> fact, it was a common way of creating swept shapes before the
> sphere_sweep primitive.

I'd thought of that but was afraid it'd be too inefficient.

> You can optimize it further by clipping of the
> inner spheres and heiarchial bounding. (Split the object in half, put
> each half in a nested union. Split each half in half, again putting the
> two halves in unions. Repeat...you end up with a heirarchial structure
> which removes most of the shapes from consideration early on in
> intersection testing.)

Ok... I'm very very new at RAY-Tracing and I'm not sure I
could follow that.  Are you saying built the object up my only
every taking the union of two shapes at a time.  Start by taking
the union of two ellipsoids.  Then taking the union of two of
those shapes and so on?  I don't know enough about how POV-Ray
works to see how that removes any of the shapes as each shape
will still form a part of the surface of the final shape.  Should merge
be used as I know it removes all the interior surfaces?  But I'm
still not sure why a merge of a merge would be faster then a
single merge.  I assume I'm missing something and my guess is
that its experience.  Would it be possible for you to post a
small piece of code that uses this "heiarchial bounding" so I
could study it and maybe get a better understanding of what
you are talking about?

Thanks,
Carl


Post a reply to this message

From: Christopher James Huff
Subject: Re: Scaling question...
Date: 29 Nov 2003 14:12:40
Message: <cjameshuff-710F40.14124629112003@netplex.aussie.org>
In article <3fc8bf38@news.povray.org>, "Carl Hoff" <hof### [at] wtnet> wrote:

> Ok... I'm very very new at RAY-Tracing and I'm not sure I
> could follow that.  Are you saying built the object up my only
> every taking the union of two shapes at a time.  Start by taking
> the union of two ellipsoids.  Then taking the union of two of
> those shapes and so on? 

Say you have 16 spheres in a line. o's are spheres, {} braces represent 
unions:
{{{{o o} {o o}} {{o o} {o o}}} {{{o o} {o o}} {{o o} {o o}}}}

Now, say you have a ray that will eventually hit the fifth sphere. The 
first bounding box test sees the bounds for the outermost union:
{                                                           }

Which it hits. The contents of that union are tested, and the next hit 
is this one:
{{                           }                              }

This eliminates half the spheres from consideration with one step. To 
continue:
{{              {           }}                              }
{{              {{   }      }}                              }
{{              {{o  }      }}                              }

Each step halves the number of remaining spheres. Note that you need to 
manually bound the unions used for this, or POV-Ray will just split it 
up and use its own automatic bounding scheme.


> Should merge be used as I know it removes all the interior surfaces? 

If the object is transparent, merge should be used, the overhead of 
removing internal surfaces is compensated for by not having to do 
texturing and lighting for those surfaces. If it is not transparent, the 
merge will be slower.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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