POV-Ray : Newsgroups : povray.general : Sphere with longitudes and latitudes? Server Time
31 Jul 2024 06:18:28 EDT (-0400)
  Sphere with longitudes and latitudes? (Message 1 to 10 of 28)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Hadmut Danisch
Subject: Sphere with longitudes and latitudes?
Date: 11 Nov 2007 13:37:31
Message: <47374beb$1@news.povray.org>
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?

regards
Hadmut


Post a reply to this message

From: Jan Dvorak
Subject: Re: Sphere with longitudes and latitudes?
Date: 11 Nov 2007 14:29:15
Message: <4737580b$1@news.povray.org>
Hadmut Danisch napsal(a):
> 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?
> 
> regards
> Hadmut
> 
use UV_mapping or warp{spherical}. Both map the <0,0>,<1,1> square onto 
the sphere. They do the same in the sphere case.
For the grid, you may use the quilted pattern.


Post a reply to this message

From: Mike Williams
Subject: Re: Sphere with longitudes and latitudes?
Date: 11 Nov 2007 14:41:06
Message: <oS4JbDAqp1NHFw72@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?

One way to do it is with layered textures.

sphere {0,1
 texture{
  pigment {gradient y
    colour_map{[0 rgb 1][0.1 rgb 0]}
    scale 0.15
  }      
 }
 texture {
  pigment {radial frequency 30
    colour_map{[0 rgb 1][0.1 rgbt <0,0,0,1>]}
  }
 }
}

The bottom layer is a gradient pigment with a small scale.

The upper layer is a radial pigment with a high frequency which is
mostly transparent so you can see the underlying gradient texture.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Mike Williams
Subject: Re: Sphere with longitudes and latitudes?
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

From: Chris B
Subject: Re: Sphere with longitudes and latitudes?
Date: 11 Nov 2007 15:20:14
Message: <473763fe@news.povray.org>
"Hadmut Danisch" <had### [at] danischde> wrote in message 
news:47374beb$1@news.povray.org...
> 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?
>
> regards
> Hadmut
>

Hi Hadmut,

There's one on http://lib.povray.org/searchcollection/index.php if you 
search for 'GridLines'. The lines are green, and the background is 
transparent, but you can readily change that.

It uses rotated copies of the gradient pattern to give a constant line 
thickness.

Regards,
Chris B


Post a reply to this message

From: Hadmut Danisch
Subject: Re: Sphere with longitudes and latitudes?
Date: 11 Nov 2007 16:23:54
Message: <473772ea@news.povray.org>
Mike Williams wrote:

> 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>]}
>   }
>  }
> }


These are exactly the two hints I was looking for.

Thanks, also to the others.

regards
Hadmut


Post a reply to this message

From: Hadmut Danisch
Subject: Re: Sphere with longitudes and latitudes?
Date: 11 Nov 2007 16:40:26
Message: <473776ca@news.povray.org>
Mike Williams wrote:

>  texture {
>   pigment {radial frequency 30
>     colour_map{[0.1 rgb 1][0.1 rgbt <0,0,0,1>]}
>   }


Just a little detail problem:

while this does what I am looking for in principle, there's one
problem: The line is not of constant width. The closer it gets to the
poles, the smaller it gets, like a slice of cake. Becomes highly visible
when the frequence gets lower, e.g. frequency 4

regards
Hadmut


Post a reply to this message

From: Jan Dvorak
Subject: Re: Sphere with longitudes and latitudes?
Date: 11 Nov 2007 16:55:30
Message: <47377a52$1@news.povray.org>
Hadmut Danisch napsal(a):
> Mike Williams wrote:
> 
>>  texture {
>>   pigment {radial frequency 30
>>     colour_map{[0.1 rgb 1][0.1 rgbt <0,0,0,1>]}
>>   }
> 
> 
> Just a little detail problem:
> 
> while this does what I am looking for in principle, there's one
> problem: The line is not of constant width. The closer it gets to the
> poles, the smaller it gets, like a slice of cake. Becomes highly visible
> when the frequence gets lower, e.g. frequency 4
> 
> regards
> Hadmut
in that case you need to invent a pigment to account for this. It might 
not be that simple.


Post a reply to this message

From: M a r c
Subject: Re: Sphere with longitudes and latitudes?
Date: 11 Nov 2007 17:03:57
Message: <47377c4d@news.povray.org>

47374beb$1@news.povray.org...
> 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?
>
> regards
> Hadmut

Why not build your lines with some tori and make an object_pattern with 
them?
You could keep constant width lines that way.

Marc


Post a reply to this message

From: Chris B
Subject: Re: Sphere with longitudes and latitudes?
Date: 11 Nov 2007 17:09:00
Message: <47377d7c@news.povray.org>
"Hadmut Danisch" <had### [at] danischde> wrote in message 
news:473776ca@news.povray.org...
> Mike Williams wrote:
>
>>  texture {
>>   pigment {radial frequency 30
>>     colour_map{[0.1 rgb 1][0.1 rgbt <0,0,0,1>]}
>>   }
>
>
> Just a little detail problem:
>
> while this does what I am looking for in principle, there's one
> problem: The line is not of constant width. The closer it gets to the
> poles, the smaller it gets, like a slice of cake. Becomes highly visible
> when the frequence gets lower, e.g. frequency 4
>
> regards
> Hadmut

That's the problem that the one on 
http://lib.povray.org/searchcollection/index.php is designed to avoid 
(search for 'GridLines').

Regards,
Chris B.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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