POV-Ray : Newsgroups : povray.general : sphere_sweep bug workaround needed : Re: sphere_sweep bug workaround needed Server Time
31 Jul 2024 06:22:58 EDT (-0400)
  Re: sphere_sweep bug workaround needed  
From: Rune
Date: 24 Aug 2007 22:05:16
Message: <46cf8e5c@news.povray.org>
Rune wrote:
> Tim Attwood wrote:
>> I'd use a macro...

Thanks by the way!

The macro you posted was very easy to adapt to my needs. I made a few monor 
adjustments, and now there's not one pixel difference between the new 
sphere+cone sweep and the sphere_sweep before - except those that were the 
error of course. ;)

#include "shapes.inc"

#macro Sphere_Sweep(SPL, from, to, rez)
   #local C = from;
   sphere {<SPL(C).x,SPL(C).y,SPL(C).z>, SPL(C).t}
   #while (C<to-rez)
      Connect_Spheres(
         <SPL(C    ).x,SPL(C    ).y,SPL(C    ).z>, SPL(C    ).t,
         <SPL(C+rez).x,SPL(C+rez).y,SPL(C+rez).z>, SPL(C+rez).t
      )
      sphere {
         <SPL(C+rez).x,SPL(C+rez).y,SPL(C+rez).z>, SPL(C+rez).t
      }
      #local C = C+rez;
   #end
   Connect_Spheres(
      <SPL(C ).x,SPL(C ).y,SPL(C ).z>, SPL(C ).t,
      <SPL(to).x,SPL(to).y,SPL(to).z>, SPL(to).t
   )
   sphere {
      <SPL(to).x,SPL(to).y,SPL(to).z>, SPL(to).t
   }
#end

Rune
-- 
http://runevision.com


Post a reply to this message

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