POV-Ray : Newsgroups : povray.general : asymmetric density maps Server Time
30 Jul 2024 00:23:50 EDT (-0400)
  asymmetric density maps (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
From: Roman Reiner
Subject: Re: asymmetric density maps
Date: 14 Jul 2010 10:15:01
Message: <web.4c3dc5fb65b32c576bb935490@news.povray.org>
"McMinty" <nomail@nomail> wrote:
> Thanks for the answer.
>
> Unfortunately, I was looking for an asymmetric density distribution.
>
> But maybe, I could try something with the translation of the density.

Densities are not restricted to spherical, cylindrical and boxed! There are a
lot of other built in patterns and on top of that you can define your very own
density functions!


Post a reply to this message

From: Alain
Subject: Re: asymmetric density maps
Date: 15 Jul 2010 17:07:16
Message: <4c3f7884@news.povray.org>

> Hello,
>
> is there a way to create asymmetric density maps?
>
> As I understand it, you can have a spherical, cylindrical or boxed density
> distribution (as the "normal" ones) where the distribution is defined with
> respect to the center:
>
> for example
>    density{ cylindrical
>      turbulence 0
>      color_map {
>       [0 rgb 0.0]//border<===
>       [1 rgb 1.0]//center<===
>       }
>     }
>
>
> But how would I "move" the area of higher density to a spot next to the center
> of my object?
>
>
> Thanks for any ideas and hints.
>
>
>
>
A few possibilities:

  - Create your object around the origin, then, rotate and translate it 
to the desired location. This should be the method of choice.
  - Rotate/translate the density to place it into your object as you like.

You can also stretch/compress the pattern using scale. To it BEFORE you 
place it in it's final location as the transformation will cause the 
pattern to move if it's not at the origin.
You can rotate the pattern as needed. Must also be done to the pattern 
at the origin, otherwise it will orbit around the origin.

Remember: ALL scale and rotate are ALWAYS done relative to the origin 
(point <0,0,0>).

You can also use about any user defined function or any of the other 
predifined patterns.


Alain


Post a reply to this message

From: Jim Charter
Subject: Re: asymmetric density maps
Date: 31 Jul 2010 11:57:38
Message: <4c5447f2$1@news.povray.org>
McMinty wrote:
> Hello,
> 
> is there a way to create asymmetric density maps?
> 
> As I understand it, you can have a spherical, cylindrical or boxed density
> distribution (as the "normal" ones) where the distribution is defined with
> respect to the center:
> 
> for example
>   density{ cylindrical
>     turbulence 0
>     color_map {
>      [0 rgb 0.0]//border   <===
>      [1 rgb 1.0]//center   <===
>      }
>    }
> 
> 
> But how would I "move" the area of higher density to a spot next to the center
> of my object?
> 
> 
> Thanks for any ideas and hints.
> 
> 
> 
> 

try black_hole warp?
not sure if it would parse but worth a try


Post a reply to this message

From: Jim Charter
Subject: Re: asymmetric density maps
Date: 31 Jul 2010 15:38:05
Message: <4c547b9d$1@news.povray.org>
camera {
   location  <0,0,-10>
   look_at   <0.0, 0.0,  0.0>
   right     x*image_width/image_height
   angle 20
}

// create a regular point light source
light_source {
   0*x                  // light's position (translated below)
   color rgb <1,1,1>    // light's color
   translate vrotate(<0,0,-100>,<60,60,0>)
}


sphere { 0, 1
   hollow
   material{
     texture{
       finish{
         ambient 0
         diffuse 1
         specular 0
         reflection 0
       }
       pigment {rgbt  .99}
     }
     interior{
       media {
         intervals 1
         samples 1,5
         emission 1
         method 3
         density{
           spherical
           warp{black_hole <2,0,0>,2}
           warp{black_hole <0,2,0>,2}
           color_map{
             [.25 rgb 0]
             [1 rgb y]
           }
         }
       }
     }
   }
}


Post a reply to this message

From: Alain
Subject: Re: asymmetric density maps
Date: 31 Jul 2010 17:33:16
Message: <4c54969c$1@news.povray.org>

> camera {
> location <0,0,-10>
> look_at <0.0, 0.0, 0.0>
> right x*image_width/image_height
> angle 20
> }
>
> // create a regular point light source
> light_source {
> 0*x // light's position (translated below)
> color rgb <1,1,1> // light's color
> translate vrotate(<0,0,-100>,<60,60,0>)
> }
>
>
> sphere { 0, 1
> hollow
> material{
> texture{
> finish{
> ambient 0
> diffuse 1
> specular 0
> reflection 0
> }
> pigment {rgbt .99}
> }
> interior{
> media {
> intervals 1
> samples 1,5
> emission 1
> method 3
> density{
> spherical
> warp{black_hole <2,0,0>,2}
> warp{black_hole <0,2,0>,2}
> color_map{
> [.25 rgb 0]
> [1 rgb y]
> }
> }
> }
> }
> }
> }

The black_hole allows you to create a local perturbation in the pattern. 
It don't allow you to translate the pattern.
Here, you pull the media into a non-spherical shape.

What was asked was how to place the media pattern relative to an object 
that is NOT defined around the origin.

In your sample, how to place correctly the spherical pattern if the 
sphere is defined as:
sphere{<125, 55, 73>, 1... instead of sphere{0,1...

Also, your sampling is way wrong.
Method 3 is the default. It needs at LEAST samples 3 and default to 
samples 10.

samples 1,5 realy mean samples 1
The second value is always ignored.

Lastly, your light is useless in that particular scene.


Alain


Post a reply to this message

From: Jim Charter
Subject: Re: asymmetric density maps
Date: 31 Jul 2010 18:31:44
Message: <4c54a450@news.povray.org>
Alain wrote:

>> camera {
>> location <0,0,-10>
>> look_at <0.0, 0.0, 0.0>
>> right x*image_width/image_height
>> angle 20
>> }
>>
>> // create a regular point light source
>> light_source {
>> 0*x // light's position (translated below)
>> color rgb <1,1,1> // light's color
>> translate vrotate(<0,0,-100>,<60,60,0>)
>> }
>>
>>
>> sphere { 0, 1
>> hollow
>> material{
>> texture{
>> finish{
>> ambient 0
>> diffuse 1
>> specular 0
>> reflection 0
>> }
>> pigment {rgbt .99}
>> }
>> interior{
>> media {
>> intervals 1
>> samples 1,5
>> emission 1
>> method 3
>> density{
>> spherical
>> warp{black_hole <2,0,0>,2}
>> warp{black_hole <0,2,0>,2}
>> color_map{
>> [.25 rgb 0]
>> [1 rgb y]
>> }
>> }
>> }
>> }
>> }
>> }
> 
> The black_hole allows you to create a local perturbation in the pattern. 
> It don't allow you to translate the pattern.
> Here, you pull the media into a non-spherical shape.
> 
> What was asked was how to place the media pattern relative to an object 
> that is NOT defined around the origin.
> 
> In your sample, how to place correctly the spherical pattern if the 
> sphere is defined as:
> sphere{<125, 55, 73>, 1... instead of sphere{0,1...
> 
> Also, your sampling is way wrong.
> Method 3 is the default. It needs at LEAST samples 3 and default to 
> samples 10.
> 
> samples 1,5 realy mean samples 1
> The second value is always ignored.
> 
> Lastly, your light is useless in that particular scene.
> 
> 
> Alain
No, he asked how to make the pattern asymmetrical. Black_hole is hardly 
a general way, or even particularly good way to do it, but it is a crude 
way to stretch a pattern arbitrarily and might suffice depending on the 
problem being addressed. Sometimes one idea leads to another.

I think you are applying your own quite limited meaning to the word 
'asymmetrical'

The scene that I provided was what I used to test if the warp would 
parse in a density statement.  I just gave a example scene that could be 
rendered to show the effect of the warp.  The light was used to dimly 
illuminate the containing media sphere. Sure, there are other ways to do it.


Post a reply to this message

From: Thomas de Groot
Subject: Re: asymmetric density maps
Date: 1 Aug 2010 03:35:25
Message: <4c5523bd$1@news.povray.org>
Yes, this works nicely indeed. I had been thinking about this issue a few 
weeks ago and decided then that warp{turbulence} was giving enough assymetry 
to the media to satisfy me. However, black_hole is giving me new ideas to 
explore.

Thanks, Jim!

Thomas


Post a reply to this message

From: Jim Charter
Subject: Re: asymmetric density maps
Date: 1 Aug 2010 17:54:21
Message: <4c55ed0d$1@news.povray.org>
Thomas de Groot wrote:
> Yes, this works nicely indeed. I had been thinking about this issue a few 
> weeks ago and decided then that warp{turbulence} was giving enough assymetry 
> to the media to satisfy me. However, black_hole is giving me new ideas to 
> explore.
> 
> Thanks, Jim!
> 
> Thomas
> 
> 
Yes the render I posted on p.b.images illustrates better what I'd had in 
mind when I originally made the suggestion: the idea of pushing the 
density off center by stretching and compressing the whole of the 
pattern.  I'd just offered this crude code snip as the barest of hints.

One wonders if nesting patterns by first converting them to functions 
might also provide this type of result.

I have long been looking for a way to smoothly change the scale of a 
pattern through space, such as you might see on a leather grain, and so 
far the only way I know to do it is with black_hole.  Whatever the 
wizardry is that underlies the black_hole warp, again I wonder if it or 
similar could be exposed for use more directly.


Post a reply to this message

From: clipka
Subject: Re: asymmetric density maps
Date: 2 Aug 2010 08:39:50
Message: <4c56bc96@news.povray.org>
Am 01.08.2010 23:54, schrieb Jim Charter:

> I have long been looking for a way to smoothly change the scale of a
> pattern through space, such as you might see on a leather grain, and so
> far the only way I know to do it is with black_hole. Whatever the
> wizardry is that underlies the black_hole warp, again I wonder if it or
> similar could be exposed for use more directly.

I'm just thinking that some "function warp" might come in handy here, 
where the user would supply three functions fx(x,y,z), fy(x,y,z), 
fz(x,y,z) mapping scene coordinates to pattern coordinates. I don't 
think it could get any more generic than that.


Post a reply to this message

From: Jim Charter
Subject: Re: asymmetric density maps
Date: 2 Aug 2010 19:14:06
Message: <4c57513e$1@news.povray.org>
clipka wrote:
> Am 01.08.2010 23:54, schrieb Jim Charter:
> 
>> I have long been looking for a way to smoothly change the scale of a
>> pattern through space, such as you might see on a leather grain, and so
>> far the only way I know to do it is with black_hole. Whatever the
>> wizardry is that underlies the black_hole warp, again I wonder if it or
>> similar could be exposed for use more directly.
> 
> I'm just thinking that some "function warp" might come in handy here, 
> where the user would supply three functions fx(x,y,z), fy(x,y,z), 
> fz(x,y,z) mapping scene coordinates to pattern coordinates. I don't 
> think it could get any more generic than that.
Well your thinking on it is going to go farther than my thinking on it 
but yes, that seems the very thing.


Post a reply to this message

<<< Previous 3 Messages Goto Initial 10 Messages

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