POV-Ray : Newsgroups : povray.general : Sphere with longitudes and latitudes? : Re: Sphere with longitudes and latitudes? Server Time
31 Jul 2024 04:14:58 EDT (-0400)
  Re: Sphere with longitudes and latitudes?  
From: Mike Williams
Date: 11 Nov 2007 14:52:43
Message: <vSDIrFAGv1NHFw6x@econym.demon.co.uk>
Wasn't it Hadmut Danisch who wrote:
>Hi,
>
>I'd like to create a sphere with lines for longitudes and latitudes,
>which basically is just a white sphere with thin black lines on horizon
>and parallel to the horizon, and lines from north to south.
>
>How would I do this?
>
>I tried to apply a texture with a color map onto the surface of the
>sphere, but the gradient is just a linear vector of x,y,z and not
>a term (e.g. the angle phi cannot be used).
>
>Another approach would be to mix the sphere with very flat and black
>cylinders which are just a little big bigger than the sphere, but then
>the sphere is not perfect anymore.
>
>How could I get a sphere with those lines?

Another way to do it is to use the phi function "f_ph()". That makes the
lines more even. You could also use the theta function "f_th()" for the
lines of longitude, but there'd be no difference from using the radial
pattern.

#include "functions.inc"

sphere {0,1
 texture{
  pigment {function {f_ph(x,y,z)*6}
    colour_map{[0.1 rgb 1][0.1 rgb 0]}
    scale 0.15
  }      
 }
 texture {
  pigment {radial frequency 30
    colour_map{[0.1 rgb 1][0.1 rgbt <0,0,0,1>]}
  }
 }
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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