POV-Ray : Newsgroups : povray.newusers : Media density Server Time
27 Dec 2024 11:07:10 EST (-0500)
  Media density (Message 1 to 10 of 23)  
Goto Latest 10 Messages Next 10 Messages >>>
From: kurtz le pirate
Subject: Media density
Date: 24 Jul 2016 04:19:12
Message: <57947a00$1@news.povray.org>
Some tests with media.

Whit this code :


hollow
pigment { rgbt 1 }
interior {
  media {
  emission 1.0
  density {
   spherical
   density_map {
    [ 0.00 rgb <0.39607808, 0.45490193, 0.97254896> ] // exterior
    [ 0.25 rgb <0.54705858, 0.59117645, 0.97941172> ]
    [ 0.50 rgb <0.69803905, 0.72745097, 0.98627448> ]
    [ 0.75 rgb <0.84901953, 0.86372548, 0.99313724> ]
    [ 1.00 rgb <1.00000000, 1.00000000, 1.00000000> ]
    }
   }
  }


1) : images are same whit or without step 0.25,0.50,0.75 in density_map.
	Why ?

2) : here, spherical pattern is use for density. is it possible to use 
other thing like gausssian curve for exemple. More generaly, how to 
change pattern with f(x,y,z) for density pattern.


Thanks


-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

From: Thomas de Groot
Subject: Re: Media density
Date: 24 Jul 2016 06:50:32
Message: <57949d78$1@news.povray.org>
On 24-7-2016 10:19, kurtz le pirate wrote:
>
> Some tests with media.
>
> Whit this code :
>
>
> hollow
> pigment { rgbt 1 }
> interior {
>  media {
>  emission 1.0
>  density {
>   spherical
>   density_map {
>    [ 0.00 rgb <0.39607808, 0.45490193, 0.97254896> ] // exterior
>    [ 0.25 rgb <0.54705858, 0.59117645, 0.97941172> ]
>    [ 0.50 rgb <0.69803905, 0.72745097, 0.98627448> ]
>    [ 0.75 rgb <0.84901953, 0.86372548, 0.99313724> ]
>    [ 1.00 rgb <1.00000000, 1.00000000, 1.00000000> ]
>    }
>   }
>  }
>
>
> 1) : images are same whit or without step 0.25,0.50,0.75 in density_map.
>     Why ?

Have you tried more contrasting colours? I do that to check how the 
pattern changes. Also be aware that in a density pattern colours are 
interpreted as grey tints.

>
> 2) : here, spherical pattern is use for density. is it possible to use
> other thing like gausssian curve for exemple. More generaly, how to
> change pattern with f(x,y,z) for density pattern.

You can use any pattern you like and also warp. See for example my 
sunset media in p.b.i. (there is an example there).


-- 
Thomas


Post a reply to this message

From: Bald Eagle
Subject: Re: Media density
Date: 24 Jul 2016 09:15:00
Message: <web.5794be691a150b855e7df57c0@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:

I'm not sure where the media and camera is in the scene, nor the scale.  I'd
either do a small separate test scene with your spherical pattern and color map,
or make a few temporary drastic changes to your scene to see "what gives"


> 2) : here, spherical pattern is use for density. is it possible to use
> other thing like gausssian curve for exemple. More generaly, how to
> change pattern with f(x,y,z) for density pattern.

I would guess it would just be something like this:

>   density {
    function (x, y, z) YourEquations.......

The docs have an "example" in the gradient pattern section.

" A more general solution is to use function{abs(x)} as a pattern instead of
gradient x and similar for gradient y and gradient z."


Post a reply to this message

From: kurtz le pirate
Subject: Re: Media density
Date: 24 Jul 2016 10:02:03
Message: <5794ca5b$1@news.povray.org>

> kurtz le pirate <kur### [at] gmailcom> wrote:
>
> I'm not sure where the media and camera is in the scene, nor the scale.  I'd
> either do a small separate test scene with your spherical pattern and color map,
> or make a few temporary drastic changes to your scene to see "what gives"

the complete scene :

// --- start ----------------------------------------------------------
#include "colors.inc"

global_settings {
  assumed_gamma 1.80
  max_trace_level 10
  }

camera {
  location <10,0,0>
  up y
  right x*image_width/image_height
  look_at <0, 0, 0>
  angle 36
  }

light_source {
  <1000,0,0>
  color White
  }

background {
  color White*0
  }


// ---------------------------------------------------------------------
#declare radiusObject = 2.0;

#declare useSphere = true;
#declare displayEdge = false;


#if (useSphere)
  sphere {
  0, radiusObject
#else
  cylinder {
  <0,0,0>, <2,0,0>, radiusObject
#end
  hollow
  pigment { rgbt 1 }
  interior {
   media {
    emission 1.0
    density {
     spherical
     density_map {
      [ 0.00 rgb <0.39607808, 0.45490193, 0.97254896> ] // exterior
      [ 0.25 rgb <0.54705858, 0.59117645, 0.97941172> ]
      [ 0.50 rgb <0.69803905, 0.72745097, 0.98627448> ]
      [ 0.75 rgb <0.84901953, 0.86372548, 0.99313724> ]
      [ 1.00 rgb <1.00000000, 1.00000000, 1.00000000> ]
      }
     }
    }
   }
  }


#if (displayEdge)
  torus {
  radiusObject, 0.01
  pigment { color Red }
  finish { ambient 0 emission 0.40 diffuse 0.60 }
  rotate 90*z
  }
#end


// --- end-------------------------------------------------------------


-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

From: kurtz le pirate
Subject: Re: Media density
Date: 24 Jul 2016 10:20:26
Message: <5794ceaa$1@news.povray.org>
Le 24/07/2016 à 12:50, Thomas de Groot a écrit :
> ...
>
> Have you tried more contrasting colours? I do that to check how the
> pattern changes. Also be aware that in a density pattern colours are
> interpreted as grey tints.

grey tints... interesting.	

>> 2) : here, spherical pattern is use for density. is it possible to use
>> other thing like gausssian curve for exemple. More generaly, how to
>> change pattern with f(x,y,z) for density pattern.
>
> You can use any pattern you like and also warp. See for example my
> sunset media in p.b.i. (there is an example there).

great exemples with 'standard' patterns.

I have difficulty understanding the relationship between the value of 
the pattern and the value of the function and how to write pattern 
function for Povray.

Classic equation for Gauss curve is :

                x^2     z^2
          - ( (-----)+(-----) )
               2.a^2   2.b^2
   y = A.e



Povray documentation sample 
(http://www.povray.org/documentation/view/3.6.1/378/) say :

#declare Foo = function { x + y + z}
pigment {
   function { Foo(x, y, z) }
   [PIGMENT_MODIFIERS...]
   }

So, #declare f_gauss = function { ? }



Thanks for your help.


-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

From: clipka
Subject: Re: Media density
Date: 24 Jul 2016 11:44:20
Message: <5794e254@news.povray.org>
Am 24.07.2016 um 10:19 schrieb kurtz le pirate:

>   density_map {
>    [ 0.00 rgb <0.39607808, 0.45490193, 0.97254896> ] // exterior
>    [ 0.25 rgb <0.54705858, 0.59117645, 0.97941172> ]
>    [ 0.50 rgb <0.69803905, 0.72745097, 0.98627448> ]
>    [ 0.75 rgb <0.84901953, 0.86372548, 0.99313724> ]
>    [ 1.00 rgb <1.00000000, 1.00000000, 1.00000000> ]
>    }
> 
> 1) : images are same whit or without step 0.25,0.50,0.75 in density_map.
>     Why ?

Because those steps are just a linear interpolation of the values at
0.00 and 1.00? ;)

If you really want steps, you'll need to specify two colour values for
one and the same parameter values, e.g.:

density_map {
  [ 0.00 rgb <0.39607808, 0.45490193, 0.97254896> ]
  [ 0.25 rgb <0.39607808, 0.45490193, 0.97254896> ]
  [ 0.25 rgb <0.54705858, 0.59117645, 0.97941172> ]
  [ 0.50 rgb <0.54705858, 0.59117645, 0.97941172> ]
  [ 0.50 rgb <0.69803905, 0.72745097, 0.98627448> ]
  [ 0.75 rgb <0.69803905, 0.72745097, 0.98627448> ]
  [ 0.75 rgb <0.84901953, 0.86372548, 0.99313724> ]
  [ 1.00 rgb <0.84901953, 0.86372548, 0.99313724> ]
  [ 1.00 rgb <1.00000000, 1.00000000, 1.00000000> ]
}


> 2) : here, spherical pattern is use for density. is it possible to use
> other thing like gausssian curve for exemple. More generaly, how to
> change pattern with f(x,y,z) for density pattern.

Look up "function pattern" (not to be confused with "pattern function").


Post a reply to this message

From: clipka
Subject: Re: Media density
Date: 24 Jul 2016 12:09:15
Message: <5794e82b$1@news.povray.org>
Am 24.07.2016 um 12:50 schrieb Thomas de Groot:

> Also be aware that in a density pattern colours are
> interpreted as grey tints.

Actually, no, they're not. They do modify the media's effective colour.


Post a reply to this message

From: Bald Eagle
Subject: Re: Media density
Date: 24 Jul 2016 12:20:00
Message: <web.5794e9df1a150b855e7df57c0@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:

> I have difficulty understanding the relationship between the value of
> the pattern and the value of the function and how to write pattern
> function for Povray.

It CAN get quite confusing.
I've actually spent most of last night and all of this morning doing just that.

I'd take a look at the isosurface tutorial in the documentation, as well as Mike
Williams' excellent and comprehensive tutorial:
http://www.econym.demon.co.uk/isotut/

and Friedrich Lohmueller's extensive and indispensable site:

http://www.f-lohmueller.de/pov_tut/addon/00_Basic_Templates/40_Isosurfaces_basic_functions/__index.htm

> Classic equation for Gauss curve is :
>
>                 x^2     z^2
>           - ( (-----)+(-----) )
>                2.a^2   2.b^2
>    y = A.e

Pardon my ignorance, but what is e, what is A, and what is your "dot notation" -
does that signify multiplication?


Post a reply to this message

From: Bald Eagle
Subject: Re: Media density
Date: 24 Jul 2016 13:00:01
Message: <web.5794f3b01a150b855e7df57c0@news.povray.org>
If you plan on doing a lot of mathematical visualization to work things out, I
keep running into this during my web searches on various topics and it looks to
be quite interesting:

http://euler-math-toolbox.de/Programs/03%20-%20Povray%20in%20Euler.html

It would be nice to supplement the docs with some scene files showing how some
of the more common as well as more complex and interesting 3D-plots can be
implemented in POV-Ray.

Add some trace(), eval_pigment(), and a few other tricks, and I'm sure there's
all sorts of fun to be had expanding on:
http://www.cescg.org/CESCG-2001/DBezak/page8.html


Post a reply to this message

From: Bald Eagle
Subject: Re: Media density
Date: 24 Jul 2016 13:30:00
Message: <web.5794faac1a150b855e7df57c0@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:

> I have difficulty understanding the relationship between the value of
> the pattern and the value of the function and how to write pattern
> function for Povray.
>
> Classic equation for Gauss curve is :
>
>                 x^2     z^2
>           - ( (-----)+(-----) )
>                2.a^2   2.b^2
>    y = A.e

Based on:
https://en.wikipedia.org/wiki/Gaussian_function#Two-dimensional_Gaussian_function

my HSV color map:
http://news.povray.org/povray.binaries.scene-files/message/%3Cweb.56e1ce6a2f1b67735e7df57c0%40news.povray.org%3E/#%3Cwe
b.56e1ce6a2f1b67735e7df57c0%40news.povray.org%3E

try this:

#declare X0 = 0;
#declare Z0 = 0;
#declare A = 1;
#declare a = 0.5;
#declare b = 0;
#declare c = 0.5;

#declare Gaussian = function {y - A * exp(   -( a*pow((x-X0),2) -
2*b*(x-X0)*(z-Z0) + c*pow((z-Z0),2) )   ) }
isosurface{ //------------------------- "sombrero"
  function {Gaussian (x, y, z)}
 open
  threshold 0
  contained_by{box{<-10, -1, -10>, <10, 1, 10>}}

  texture{
    pigment{ TempGradient scale <1, 1.1, 1>}
    //normal { ripples 0.5 scale 0.125}
    //finish { phong 1}
 translate <0, -0.1, 0>
  } // end of texture
  scale <1, 5, 1>
  rotate <0,0,0>
  translate <0, 0, 0>
} // end of isosurface ----------------


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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