POV-Ray : Newsgroups : povray.binaries.images : flying police car WIP : Re: flying police car WIP Server Time
30 Jul 2024 06:18:12 EDT (-0400)
  Re: flying police car WIP  
From: s day
Date: 5 May 2013 06:10:04
Message: <web.51862f4cbc86cde3449e5060@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> The spline requirement for the sphere_sweep is indeed a tricky thing to come up
> with (re: my particular windshield outline.) What I imagine is that the spline
> might not end up exactly following the correct curve. But that's just
> theorizing; I should give it a chance, to see what happens.

You could always use a linear spline with lots of points, this would follow your
spline points exactly and can be made to look pretty smooth e.g.

union
{
sphere_sweep {
  linear_spline                 // linear curve
  //cubic_spline                // alternative spline curves
  //b_spline
  #declare np=80;
  #declare p=0;
#declare r=0;
  np+1,                            // number of specified sphere positions
#while ( p < np+1 )
  vrotate(<0,-10, 0>, <0, 0, r>), 1
  #declare r=r+360/np;
  #declare p=p+1;
  #end
 // tolerance 0.001             // optional

  pigment { rgb <1, 0, 0> }
  finish { specular 0.5 roughness 0.01 }
}
  bounded_by { box { <-11, -11, -1> <11, 11, 1> } }
 }


produces the torus shape below. I recommend adding a bounded_by as performance
is pretty poor otherwise and probably as part of the spline bounding issue it
seems that you have to put the sphere_sweep inside a union and bound the union
otherwise it makes no difference to performance.

Sean


Post a reply to this message


Attachments:
Download 'sphere_sweep.bmp.dat' (1407 KB)

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