POV-Ray : Newsgroups : povray.newusers : trace function question : trace function question Server Time
29 Jul 2024 02:22:51 EDT (-0400)
  trace function question  
From: serfurj
Date: 15 Jan 2007 20:15:00
Message: <web.45ac26897946a67f75f97caf0@news.povray.org>
Hi, I'm trying to make the following script place the cylinders evenly on
the sphere, but they're showing up clustered.  Any idea why?  How can I
place them evenly on the sphere?

The original script was from:
http://www.povray.org/documentation/view/3.6.1/229/#s02_02_01_04_05_i5

Thanks.



#include "colors.inc"

camera {
      angle 20
      location<-5,10,10>
      look_at<0,0,0>
}

light_source { <0, 15, 10> color White }

background { White }

#declare MySphere = sphere { <0, 0, 0>, 1 }

object {
  MySphere
  texture {
    pigment { rgb 1}
  }
}

#declare R1 = seed(339);
#declare Cnt = 0;

#while (Cnt<500)
  #declare Norm = <0, 0, 0>;
  #declare Start = <rand(R1), rand(R1), rand(R1)>;
  #declare Inter = trace ( MySphere, Start, <0, 0, 0>-Start, Norm );

  #if (vlength(Norm)!=0)
    cylinder {
      Inter, Inter+Norm, .1
      texture {
        pigment {color red 1}
      }
    }
  #end

  #declare Cnt = Cnt+1;
#end


Post a reply to this message

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