POV-Ray : Newsgroups : povray.general : the trace function and toroidal objects : Re: the trace function and toroidal objects Server Time
4 Nov 2024 19:21:12 EST (-0500)
  Re: the trace function and toroidal objects  
From: Mike Williams
Date: 1 Oct 2003 01:32:36
Message: <mwgFSCAFame$EwSJ@econym.demon.co.uk>
Wasn't it  who wrote:
>I did some experiments and have reached the unambiguous conclusion that 
>the trace function will not hit the inside of the torus.  If anyone can 
>claim they're sure it works for them, I don't know what to say.  I'm using 
>MegaPOV 1.0, by the way.

I came very close to agreeing with you (except that I was using POV 3.5)
My mistake was using  "trace(Shape,Q,P)" in the following code instead
of "trace(Shape,Q,P-Q)". Perhaps you're doing something simlar.

#include "functions.inc"

global_settings {assumed_gamma 1.0}

camera { location  <-1, 3, -4> look_at <0, 0, 0> angle 27}

background {rgb <0.5,0.6,0.7>}

light_source {<-100,200,-100> colour rgb 1}

#declare F_bozo=function{
  pigment{bozo
     colour_map {[0 rgb 0][1 rgb 1]}
     scale 0.2
  }
}

#declare Shape=
isosurface {
  function { f_torus(x,y,z,0.7,0.5) + F_bozo(x,y,z).grey*0.3}
        max_gradient 2
        contained_by{sphere {0,1.3}}
        pigment {rgb 0.1}
        finish {phong 0.5 phong_size 10}
}

object {Shape}

#declare A=0;
#while (A<360)
  #declare B=0;
  #while (B<360)
    #declare P = vrotate(vrotate(<0,0.5,0>,A*z) + x*0.7, B*y);
    #declare Q = vrotate(x*0.7, B*y);
    #declare T = trace(Shape,Q,P-Q);
    sphere {T,0.03 pigment {rgb 1}}
    #declare B=B+8;
  #end
  #declare A=A+15;
#end


Post a reply to this message

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