POV-Ray : Newsgroups : povray.general : Sphere/polyherdon question : Re: Sphere/polyherdon question Server Time
3 Aug 2024 12:14:34 EDT (-0400)
  Re: Sphere/polyherdon question  
From: Thies Heidecke
Date: 2 May 2004 10:29:38
Message: <409505d2$1@news.povray.org>
"Ilia Guzei" <igu### [at] fozziechemwiscedu> schrieb im Newsbeitrag
news:40941f69@news.povray.org...
> I need to approximate a sphere with 60,000 points.  How can I generate
such
> a polyhedron with equivalent points on the sphere?  Perhaps a C algorithm
is
> posted some place on this web site but I can't find it.
Hi,

I would use a golden-section-based "Sunflower"-Distribution.
I've made a small POV-Scene which demonstrates this.
I think you won't have problems writing a similar C-program
off the POV-Source.

Source:


#version 3.5;

global_settings {
  assumed_gamma 1.0
}
camera {
  location  <1.3, 3.5, -1.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 {
  <-20, 30, -60>
  color rgb <0.9, 0.7, 0.3>
}
light_source {
  <70, 40, 80>
  color rgb <0.1, 0.3, 0.9>
}


#declare N  =  6000; // Number of Spheres
#declare M  =  N;
#declare sr = 1 * 2/sqrt(N);  // sphereradius
#declare phi= 0;
#declare gsa= 360*((sqrt(5)-1)/2);  // golden section angle
#declare py = -1;
#declare dy = 2/(N-1);

#while(M>0)
  sphere {
    py*y, sr
    translate sqrt(1-py*py)*x
    rotate phi*y
    texture {
      pigment{color rgb 1}
      finish{ambient 0 diffuse 0.5 reflection{0.6}}
    }
  }
  #declare py=-1+2*(M-1)/(N-1);
  #declare phi=phi+gsa;
  #declare M=M-1;
#end


> Thanks,
> Ilia
Regards,
Thies


Post a reply to this message

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