POV-Ray : Newsgroups : povray.newusers : Losing my mind : Re: Losing my mind Server Time
15 May 2024 06:00:41 EDT (-0400)
  Re: Losing my mind  
From: Samuel Benge
Date: 2 Apr 2014 18:25:00
Message: <web.533c8d37f07ab8a2f040ad170@news.povray.org>
// this code is better (the last version had size/alignment issues)

plane{y, 0 pigment{rgb .5}}

#declare SP = <0, 7, 0>; // sphere position
#declare SS = 4; // sphere size
#declare NP = SP + y*SS; // north pole

#declare TO = sphere{SP, SS}; // globe for rendering and trace()ing

object{TO pigment{rgb .5}}
sphere{NP, .2 pigment{rgb <1, 1, .1>}}

union{
 #local GS = 20;
 #for(Z, 0, GS)
  #for(X, 0, GS)

   #declare GP = <X, 0, Z>; // grid point
   #declare GP = GP - (x+z)*GS/2; // center the grid
   #declare TP = trace(TO, GP, NP-GP); // trace point

   sphere{GP, .2} // grid spheres on the plane
   sphere{TP, .1} // grid spheres on the globe

  #end
 #end
 pigment{rgb <1, 1, .1>}
}


Post a reply to this message

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