POV-Ray : Newsgroups : povray.newusers : Plotting points on a sphere? : Re: Plotting points on a sphere? Server Time
31 Jul 2024 04:16:15 EDT (-0400)
  Re: Plotting points on a sphere?  
From: Christopher James Huff
Date: 3 Jan 2003 16:13:24
Message: <cjameshuff-F1A653.16092003012003@netplex.aussie.org>
In article <3e14cfaf@news.povray.org>,
 "Jessie K. Blair" <lor### [at] aolcom> wrote:

> Knowledge of any of those methods would be nice.  Be for simplicity's sake,
> the crossings of the lat/long lines is just what I was looking for.

Well, getting a single point is easy:
vrotate(-z*Radius, < Lat, Long, 0>) + Center

So, use 2 nested loops to loop through the desired points:

#declare LatLines = 12;
#declare LongLines = 24;

#declare Lat = 0;
#while(Lat < LatLines)
    #declare Long = 0;
    #while(Long < LongLines)
        sphere {vrotate(-z*Radius, < 180*Lat/LatLines - 90, 
360*Long/LongLines, 0>) + Center, 0.1}
or
        sphere {-z*Radius, 0.1
            rotate < 180*Lat/LatLines - 90, 360*Long/LongLines, 0>
            translate Center
        }
        #declare Long = Long + 1;
    #end
    #declare Lat = Lat + 1;
#end

This isn't anywhere close to an even distribution though, if that is 
what you want.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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