POV-Ray : Newsgroups : povray.bugreports : sphere slicing problem : Re: sphere slicing problem Server Time
19 Oct 2021 12:55:09 EDT (-0400)
  Re: sphere slicing problem  
From: jr
Date: 15 Oct 2019 09:50:00
Message: <web.5da5cd57401c5809feeb22ff0@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> I did this real quick - I'm off to work - but try putting the object LAST in the
> hierarchy so that the CSG inherits ITS texture properties, not the other way
> around.
>
>  #version 3.8;
>  global_settings {assumed_gamma 1.0 }
>  #include "colors.inc"
> #declare Aspect = image_width/image_height;
>  camera {
>   location <0, 5, -10>
>   right x*Aspect
>   look_at <0, 0, 0>
>  }
> light_source {<0, 5, -10> color White}
> plane {z, 1 pigment {White*0.2}}
> #declare Line = 0.015;
> #declare LinePigment = pigment {Yellow+White/2}
> #declare Slice = 0.1;
> #declare Sphere = difference {sphere {0, 0.5 } sphere {0, 0.3 }}
> #declare Box = box {<-1, 0, -1> <1, -Slice, 1>}
> #declare E = 0.000001;
> #for (M, -0.5, 0.5, Slice)
>  intersection {
>   object {Box translate y*M}
>   object {Sphere}
>   translate x*M*10
>   pigment {Red}
>  }
> #end


hey, thanks.  ran the following modification with '+kfi0 +kff11':

#version 3.8;

global_settings {assumed_gamma 1.0}

#include "colors.inc"

camera {
  orthographic
  location <0, 5, 0>
  look_at <0, 0, 0>
  sky <0,0,1>
}

light_source {<0, 5, 10> color White}
light_source {<0, 5, -10> color White}
light_source {<10, 5, 0> color White}
light_source {<-10, 5, 0> color White}

#declare Slice = 0.1;
#declare Sphere = sphere {0,.5 pigment {Red}};
#declare Box = box {<-1, 0, -1> <1, -Slice, 1> pigment {srgbt 1}};

#if (11 > frame_number)
  #declare M = -.5 + frame_number * Slice;
  intersection {
    object {Sphere}
    object {Box translate y*M}
  }
#end

order of elements in intersection not the problem, nor the container, as I
understand now.  see reply to Bill P for rest.


regards, jr.


Post a reply to this message

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