POV-Ray : Newsgroups : povray.general : Transforming an onion pattern Server Time
31 Oct 2024 18:53:23 EDT (-0400)
  Transforming an onion pattern (Message 1 to 5 of 5)  
From: Mike Horvath
Subject: Transforming an onion pattern
Date: 22 Feb 2018 17:23:59
Message: <5a8f42ff$1@news.povray.org>
I'm trying to create a layer of clouds over my spherical planet. I am 
using a combination of wrinkles and onion patterns. I can scale the 
onion pattern to the thickness of the clouds, but I am not sure how to 
align the start of the onion to the surface of the planet.

E.g.

The planet radius is X units. The clouds start at X + M units and end at 
X + N units. What is the correct way to create this onion? Do I need to 
use frequency and phase modifiers?

Thanks.


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Transforming an onion pattern
Date: 22 Feb 2018 18:39:57
Message: <5a8f54cd$1@news.povray.org>
Disregard. I ended up using this:


	#local inner_radius = earth_radius + cloud_min_radius;
	#local outer_radius = earth_radius + cloud_max_radius;
	#local inn_out_ratio = inner_radius/outer_radius;
		density
		{
			spherical		// spherical = 1 in the middle, 0 at the edge
			color_map
			{
				[0.00 color rgb 0.00]
				[1-(inn_out_ratio + (1-inn_out_ratio)*0.90) color rgb 1.00]
				[1-(inn_out_ratio + (1-inn_out_ratio)*0.40) color rgb 1.00]
				[1-(inn_out_ratio + (1-inn_out_ratio)*0.00) color rgb 0.00]
				[1.00 color rgb 0.00]
			}
			scale outer_radius
		}


Post a reply to this message

From: Alain
Subject: Re: Transforming an onion pattern
Date: 22 Feb 2018 18:44:01
Message: <5a8f55c1$1@news.povray.org>
Le 18-02-22 à 17:24, Mike Horvath a écrit :
> I'm trying to create a layer of clouds over my spherical planet. I am 
> using a combination of wrinkles and onion patterns. I can scale the 
> onion pattern to the thickness of the clouds, but I am not sure how to 
> align the start of the onion to the surface of the planet.
> 
> E.g.
> 
> The planet radius is X units. The clouds start at X + M units and end at 
> X + N units. What is the correct way to create this onion? Do I need to 
> use frequency and phase modifiers?
> 
> Thanks.
> 
> 
> Mike

Scale your onion pattern so that one period = hight of the athmosphere.
Next, use a colour_map that have a zero value outside of the cloud layer.
On the bottom, have a rapid transition, and a more gradual transition 
toward the top.


Post a reply to this message

From: Sven Littkowski
Subject: Re: Transforming an onion pattern
Date: 23 Feb 2018 11:49:27
Message: <5a904617$1@news.povray.org>
I would allow the onion to begin at the center of the planet. If the
planet sphere has a radius of 99 units, the onion sphere could have a
radius of 100 (just an example). All areas of the onion inside the plant
should be fully transparent
[ 0.00 color rgbf 1.0 ]
[ 0.99 color rgbf 1.0 ]
and only from 0.99 on you can do your atmospheric magic. From 0.99 on,
you might have to work with very low value differences.

I hope I understood your problem correctly.

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

From: Alain
Subject: Re: Transforming an onion pattern
Date: 23 Feb 2018 22:20:05
Message: <5a90d9e5$1@news.povray.org>
Le 18-02-23 à 11:49, Sven Littkowski a écrit :
> I would allow the onion to begin at the center of the planet. If the
> planet sphere has a radius of 99 units, the onion sphere could have a
> radius of 100 (just an example). All areas of the onion inside the plant
> should be fully transparent
> [ 0.00 color rgbf 1.0 ]
> [ 0.99 color rgbf 1.0 ]
> and only from 0.99 on you can do your atmospheric magic. From 0.99 on,
> you might have to work with very low value differences.
> 
> I hope I understood your problem correctly.
> 
> ---
> Diese E-Mail wurde von AVG auf Viren geprüft.
> http://www.avg.com
> 

Probably better to scale it smaller.
If the scaling factor is similar, but slightly smaller, to the radius of 
the surface, then, the zero point of the map will be just slightly under 
the surface. Making the scaling slightly smaller is useful if you have 
an isosurface based body to ensure that you don't get upper atmosphere 
in the deepest valleys.
So, in the case of a 99 unit radius planet with a 1 unit thick 
atmosphere, you don't need any scaling at all. The pattern will repeat 
99 times under the surface, where it's totally invisible, and you only 
see the 100th period. The 101th period is outside the container and 
never used.
This makes the construction of the colour_map much easier as you are now 
working in term of % of the atmosphere thickness instead of (planetary + 
atmospheric) radius.


Alain


Post a reply to this message

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