POV-Ray : Newsgroups : povray.general : Saturn Ring mapping? Server Time
4 Nov 2024 07:15:32 EST (-0500)
  Saturn Ring mapping? (Message 1 to 8 of 8)  
From: How Camp
Subject: Saturn Ring mapping?
Date: 5 Oct 2006 14:25:13
Message: <45254e09$1@news.povray.org>
I've downloaded a couple of transparency and color maps for Saturn's rings 
from various locations on the internet (such as: 
http://www.mmedia.is/~bjj/data/s_rings/index.html), but I'm having trouble 
figuring out exactly how to use these color/transparency 'strips' in an 
actual texture.  Best I can do is get the texture applied in some screwy 
radial fashion instead of onion-like concentric rings.

Would anyone be so kind as to show me a simple example of how to effectively 
use these images to map onto a disc (or similar)?

- How


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Saturn Ring mapping?
Date: 5 Oct 2006 15:45:01
Message: <web.4525602153152476c150d4c10@news.povray.org>
"How Camp" <hac### [at] gmailcom> wrote:
> I've downloaded a couple of transparency and color maps for Saturn's rings
> from various locations on the internet (such as:
> http://www.mmedia.is/~bjj/data/s_rings/index.html), but I'm having trouble
> figuring out exactly how to use these color/transparency 'strips' in an
> actual texture.  Best I can do is get the texture applied in some screwy
> radial fashion instead of onion-like concentric rings.
>
> Would anyone be so kind as to show me a simple example of how to effectively
> use these images to map onto a disc (or similar)?
>
> - How

Interesting.  I don't think any of the map_types will give you what you are
looking for.  The way I understand it, the strips represent one radial line
of the ring, and it needs to be swept around the origin.  You likely need to
use user-defined functions to transform the images into a radial pattern.
If I get time, I'll try to throw together an example for you unless someone
else has a better idea how to do it.

-tgq


Post a reply to this message

From: PoD
Subject: Re: Saturn Ring mapping?
Date: 6 Oct 2006 04:15:22
Message: <pan.2006.10.06.08.15.21.475780@internode.on.net>
On Thu, 05 Oct 2006 14:26:29 -0400, How Camp wrote:

> I've downloaded a couple of transparency and color maps for Saturn's rings 
> from various locations on the internet (such as: 
> http://www.mmedia.is/~bjj/data/s_rings/index.html), but I'm having trouble 
> figuring out exactly how to use these color/transparency 'strips' in an 
> actual texture.  Best I can do is get the texture applied in some screwy 
> radial fashion instead of onion-like concentric rings.
> 
> Would anyone be so kind as to show me a simple example of how to effectively 
> use these images to map onto a disc (or similar)?
> 
> - How

The simplest way I can think of would be to compose the transparency and
RGB images into a single RGBA image, then uv map it onto a ring shaped
mesh.

The only other idea I had is rather crazed.  Create a bunch of colour_maps
and then combine them together with a pigment_map using wood pattern for
them all.

-- 
PoD


Post a reply to this message

From: Roman Reiner
Subject: Re: Saturn Ring mapping?
Date: 6 Oct 2006 05:45:01
Message: <web.452624055315247699ba499e0@news.povray.org>
I just can't memorize how to get back the colors from a pigment function let
alone transparency. I think it was possible with splines... anyway, this
should at least handle the mapping issue:

//start code

camera {
  location <-25,50,-150>
  look_at <0,0,-75>
  angle 65
}

light_source {
  <50,25,-150>
  rgb <1.7,1.4,1.2>
}

#declare r=75; //minor radius
#declare R=100; //major radius

#declare f_pigm = function { pigment { image_map {  png "testimage.png"
interpolate 2 }}};
//replace with your testimage

#declare f_pigm2 = function {
f_pigm((x-r)/(R-r),(y+.375*(R-r))/(.75*(R-r)),z) };
//scaled and translated function which matchs the radii of the ring

#declare f_rad = function { sqrt(x*x+y*y+z*z) } //returns the distance from
origin

disc {
  0, y, R, r
  pigment {
    function {
      f_pigm2(f_rad(x,y,z),0,0).gray
      //this is where it happens, no more colors here :(
    }
  }
}

polygon { //displaying the test image
  4,
  <0,0,0>,
  <0,1,0>,
  <1,1,0>,
  <1,0,0>
  pigment {
    image_map {
      png "testimage.png" interpolate 2 transmit all .5
    }
  }
  finish { ambient 1 diffuse 0 }
  scale <R-r,.75*(R-r),1>
  translate <r,-.375*(R-r),0>
  rotate y*60
  no_shadow
}
//end code

Hope this helps!
Regards Roman


Post a reply to this message

From: Roman Reiner
Subject: Re: Saturn Ring mapping?
Date: 6 Oct 2006 05:55:00
Message: <web.4526273c5315247699ba499e0@news.povray.org>
Argh. this leads to an error. put the .gray to the definition of f_pigm2
instead:

#declare f_pigm2 = function {
f_pigm((x-r)/(R-r),(y+.375*(R-r))/(.75*(R-r)),z).gray };

I need easy to handle vector functions *whines* ;o)

Regards Roman


Post a reply to this message

From: Marc
Subject: Re: Saturn Ring mapping?
Date: 6 Oct 2006 07:56:06
Message: <45264456@news.povray.org>

45254e09$1@news.povray.org...
>
> Would anyone be so kind as to show me a simple example of how to
effectively
> use these images to map onto a disc (or similar)?
>
> - How (?)

This way ;-)


camera {
  location  <0.0, 15, -30>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
  angle 5
}



light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>*1.5  // light's color
  translate <-30, 3, -30> *1000
}
#declare Int_radius =1; //disc minor radius
#declare Ring_width= 0.2; //disc width
#declare Lum=3; // color luminance
#declare T_factor=0.5; //transparency map amount

// functionalization of the colormap
#declare img =
  pigment{
   image_map{
    png"sat_ring_color.png"
   }
   scale Ring_width
  }

#declare f_img =
function{
  pigment{ img }
}

// functionalization of the transparency map

   #declare trans =
  pigment{
   image_map{
    png"transparency.png"
   }
   scale Ring_width
  }

#declare f_trans =
function{
  pigment{ trans }
}

//recombination of color componants in a concentric way
#declare Ring_pig =
  pigment{
   average
   pigment_map{
    [1 function{ f_img(sqrt(x*x+y*y)-Int_radius,0,0).x } color_map{[0 rgb
0][1 rgb x*Lum]} ]
    [1 function{ f_img(sqrt(x*x+y*y)-Int_radius,0,0).y } color_map{[0 rgb
0][1 rgb y*Lum]} ]
    [1 function{ f_img(sqrt(x*x+y*y)-Int_radius,0,0).z } color_map{[0 rgb
0][1 rgb z*Lum]} ]
    [1 function{ f_trans(sqrt(x*x+y*y)-Int_radius,0,0).z } color_map{[0 rgb
0][1 rgbt<0,0,0,1>*T_factor ]} ]
   }
  }

disc { <0, 0, 0>, z,Int_radius+Ring_width, Int_radius texture {pigment
{Ring_pig }finish{ambient 0 diffuse 1 brilliance 0.2}}rotate x*90}

sphere{0,Int_radius*.8 texture{pigment{color rgb 1} finish {ambient 0
diffuse .6 }}}//place holder


HTH
Marc


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Saturn Ring mapping?
Date: 6 Oct 2006 10:10:00
Message: <web.4526635b53152476c150d4c10@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> "How Camp" <hac### [at] gmailcom> wrote:
> Interesting.  I don't think any of the map_types will give you what you are
> looking for.  The way I understand it, the strips represent one radial line
> of the ring, and it needs to be swept around the origin.  You likely need to
> use user-defined functions to transform the images into a radial pattern.
> If I get time, I'll try to throw together an example for you unless someone
> else has a better idea how to do it.
>
> -tgq

Here's an attempt at mapping the rings and texture properties using the
given images.  (I didn't map the underside image though)

//START
global_settings {
  assumed_gamma 1
}

#declare CamLoc= <200,50,200>;
#declare SunLoc= <5000,2000,-5000>;

camera {
  right x*image_width/image_height
  location  CamLoc
  look_at   0
}

#declare LB=
sphere{0 500 hollow no_image
  photons {collect off pass_through}
  texture{pigment{rgb 1} finish{ambient 25}}
}

light_source{0
  rgb 2
  looks_like{LB}
  fade_power 2
  fade_distance 5500
  translate SunLoc
}



#local PIMAGEb000 = function {pigment{image_map {png "SRb000.png"
interpolate 2}}} //back scattered light (0 deg)
#local PIMAGEb139 = function {pigment{image_map {png "SRb139.png"
interpolate 2}}} //forward scattered light (139 deg)
#local PIMAGEc = function {pigment{image_map {png "SRc.png" interpolate 2}}}
      //colour map
#local PIMAGEt = function {pigment{image_map {png "SRt.png" interpolate 2}}}
      //transparency

#macro CMap(C,T) color_map{[0 rgbt <0,0,0,T>][1 rgbt C*3+<0,0,0,T>]} #end

#declare RingIR=74.510; //inner ring radius
#declare RingOR=140.390; //outer ring radius

#declare FUNKY=function{(sqrt(x*x+z*z)-RingIR)/(RingOR-RingIR)}

#declare
FRe=function{select(FUNKY(x,y,z),0,select(1-FUNKY(x,y,z),0,PIMAGEc(FUNKY(x,y,z),0,0).red))}
#declare
FGr=function{select(FUNKY(x,y,z),0,select(1-FUNKY(x,y,z),0,PIMAGEc(FUNKY(x,y,z),0,0).green))}
#declare
FBl=function{select(FUNKY(x,y,z),0,select(1-FUNKY(x,y,z),0,PIMAGEc(FUNKY(x,y,z),0,0).blue))}
#declare
FTr=function{select(FUNKY(x,y,z),1,select(1-FUNKY(x,y,z),1,PIMAGEt(FUNKY(x,y,z),0,0).gray))}

#declare CL=vnormalize(<CamLoc.x,CamLoc.z>); //camera loc normalized
#declare SL=vnormalize(<SunLoc.x,SunLoc.z>); //sun loc normalized
#declare PA=degrees(acos(vdot(CL,SL)));//phase angle

#declare
FBr000=function{select(FUNKY(x,y,z),1,select(1-FUNKY(x,y,z),1,PIMAGEb000(FUNKY(x,y,z),0,0).gray))}
//brightness at 0deg
#declare
FBr139=function{select(FUNKY(x,y,z),1,select(1-FUNKY(x,y,z),1,PIMAGEb139(FUNKY(x,y,z),0,0).gray))}
//brightness at 139deg
#declare
FBr=function{FBr000(x,y,z)+(FBr139(x,y,z)-FBr000(x,y,z))*(PA)/(139)};
                       //interpolate brightness at phase angle (assume
linear)

#declare B=3;//ring brightness factor

#declare RCola=//fully opaque
pigment{average
  pigment_map {
    [function{FRe(x,y,z)*FBr(x,y,z)} CMap(<B,0,0>,0)]
    [function{FGr(x,y,z)*FBr(x,y,z)} CMap(<0,B,0>,0)]
    [function{FBl(x,y,z)*FBr(x,y,z)} CMap(<0,0,B>,0)]
  }
}
#declare RColb=//fully transparent
pigment{average
  pigment_map {
    [function{FRe(x,y,z)*FBr(x,y,z)} CMap(<B,0,0>,1)]
    [function{FGr(x,y,z)*FBr(x,y,z)} CMap(<0,B,0>,1)]
    [function{FBl(x,y,z)*FBr(x,y,z)} CMap(<0,0,B>,1)]
  }
}


#declare RCol2=//map colour to transparency
pigment{
  function{FTr(x,y,z)}
  pigment_map{
    [0 RCola]
    [1 RColb]
  }
}


disc {
  <0, 0, 0>  // center position
  y,         // normal vector
  RingOR,       // outer radius
  RingIR        // optional hole radius
  pigment{RCol2} finish{diffuse 0.5}
}


sphere{0 1
  texture{
    pigment{image_map{jpeg "saturn.jpg" interpolate 2 map_type 1}}
    finish{diffuse 0.6}
  }
  scale<60.268,54.362,60.268>
}
//END


Post a reply to this message

From: How Camp
Subject: Re: Saturn Ring mapping?
Date: 6 Oct 2006 12:26:56
Message: <452683d0$1@news.povray.org>
"Marc" <jac### [at] wanadoofr> wrote in message 
news:45264456@news.povray.org...
> This way ;-)


Oh, excellent!  Thank you, everyone.  Several of these ideas have helped me 
come to a satisfactory solution.  Saturn looks much better with its rings... 
:)

- How


Post a reply to this message

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