POV-Ray : Newsgroups : povray.beta-test : bug in sphere_sweep for removing parts of an object : bug in sphere_sweep for removing parts of an object Server Time
18 Apr 2024 11:09:44 EDT (-0400)
  bug in sphere_sweep for removing parts of an object  
From: Andrel C  Linnenbank
Date: 14 Dec 2001 15:09:24
Message: <3C1A5D47.EA38F6E5@amc.uva.nl>
I am not entirely sure if this has been reported before.
I used  povray v3.5b8 on a 750MHz PIII, windows 98

When using sphere_sweep to generate a hollow tube there are 
some problems in rendering the inside of the tube.

Strange bands of discontinuous normals seem to appear in areas where

the spheres make a bend.



Below is a 'small' example that shows the problem.



Second point is that I used a parameterization for the sizes

of the spheres that depended on the clock to generate an animation.

It was a rather complex formula. I now use a different method where 

I generate an different include file for every frame. The reason 

is that this seems to be much faster. Apparently the formula 

is computed for every pixel in stead of ones per frame. I

think some caching may improve the speed of rendering. 



	Andrel



----

#version 3.5;



#include "colors.inc"



global_settings {

  assumed_gamma 1.0

}



// ----------------------------------------



camera {

  location  <0.0, 0.5, -4.0>

  direction 1.5*z

  right     x*image_width/image_height

  look_at   <0.0, 0.0,  0.0>

}



sky_sphere {

  pigment {

    gradient y

    color_map {

      [0.0 rgb <0.6,0.7,1.0>]

      [0.7 rgb <0.0,0.1,0.8>]

    }

  }

}



light_source {

  <0, 0, 0>            // light's position (translated below)

  color rgb <1, 1, 1>  // light's color

  translate <-0, 5, -10>

}



// ----------------------------------------



plane {

  y, -1

  pigment { color rgb <0.3,0.7,0.3> }

}





intersection{

sphere_sweep {

 catmull_rom_spline

 11,

 <-0.785398,0.000000,0.000000>,0.684887,

 <-0.392699,0.000000,0.000000>,0.747715,

 <0.000000,0.000000,0.000000>,0.779126,

 <0.342020,0.060307,0.000000>,0.792240,

 <0.642788,0.233956,0.000000>,0.797142,

 <0.866025,0.500000,0.000000>,0.798889,

 <0.984808,0.826352,0.000000>,0.799517,

 <0.984808,1.173648,0.000000>,0.799752,

 <0.866025,1.500000,0.000000>,0.799843,

 <0.642788,1.766044,0.000000>,0.799875,

 <0.342020,1.939693,0.000000>,0.799871

}// end sphere_sweep

sphere_sweep {

 catmull_rom_spline

 11,

 <-0.785398,0.000000,0.000000>,0.479132,

 <-0.392699,0.000000,0.000000>,0.545101,

 <0.000000,0.000000,0.000000>,0.578083,

 <0.342020,0.060307,0.000000>,0.591852,

 <0.642788,0.233956,0.000000>,0.596999,

 <0.866025,0.500000,0.000000>,0.598833,

 <0.984808,0.826352,0.000000>,0.599492,

 <0.984808,1.173648,0.000000>,0.599739,

 <0.866025,1.500000,0.000000>,0.599835,

 <0.642788,1.766044,0.000000>,0.599868,

 <0.342020,1.939693,0.000000>,0.599865



inverse }// end sphere_sweep

box{<-3.141593,-1,-.15><2,3,1>}

bounded_by{box{<-3.141593,-1,-.15><2.284808,3.3,1>}}

  translate x*2.5+y*-3+z*-3

  scale .5           

  rotate x*45+y*40

  pigment { color rgb <1,0.2,0.0> } 

  finish{specular .3} 

}// end difference


Post a reply to this message

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