POV-Ray : Newsgroups : povray.general : Animating Color Maps Server Time
6 Aug 2024 17:00:25 EDT (-0400)
  Animating Color Maps (Message 1 to 5 of 5)  
From: Mitchell Waite
Subject: Animating Color Maps
Date: 11 Feb 2002 23:16:48
Message: <3c689730$1@news.povray.org>
Question for experts here.

Is there a way to animate a color map in POV Ray. In other words say I have
a terrain aerial map in color. I want to make an animation showing the color
of the trees going from green to brown and snow to appear. I can paint up
different color maps but how would I get them to change in POV Ray?

thanks,

Mitch


Post a reply to this message

From: Warp
Subject: Re: Animating Color Maps
Date: 11 Feb 2002 23:25:39
Message: <3c689943@news.povray.org>
Mitchell Waite <mit### [at] dnaicom> wrote:
: Is there a way to animate a color map in POV Ray. In other words say I have
: a terrain aerial map in color. I want to make an animation showing the color
: of the trees going from green to brown and snow to appear. I can paint up
: different color maps but how would I get them to change in POV Ray?

  You can try something like this:

#declare Colors1 = array[3] { <0,0,0>, <1,0,0>, <1,1,0> }
#declare Colors2 = array[3] { <0,1,0>, <1,1,0>, <1,1,1> }
...
  color_map
  { #declare ColorsAmnt = dimension_size(Colors1, 1);
    #declare Ind = 0;
    #while(Ind < ColorsAmnt)
      #declare factor = Ind/(ColorsAmnt-1);
      [factor Colors1[Ind]*(1-factor)+Colors2[Ind]*factor]
      #declare Ind = Ind+1;
    #end
  }

  Note that it works only if both color maps have the same number of
colors. Adding support for color maps with differing amount of colors makes
the problem a quite more complicated (but not impossible).
  Also if the colors are not distributes equally in the color_map, it would
need extra arrays for the index values.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Chris Colefax
Subject: Re: Animating Color Maps
Date: 11 Feb 2002 23:44:39
Message: <3c689db7@news.povray.org>
Mitchell Waite <mit### [at] dnaicom> wrote:
> Is there a way to animate a color map in POV Ray. In other words say I
have
> a terrain aerial map in color. I want to make an animation showing the
color
> of the trees going from green to brown and snow to appear. I can paint up
> different color maps but how would I get them to change in POV Ray?

You can animate colour maps directly by adjusting their index and colour
values using the clock, e.g.:

color_map {
    [From (0, 0.1) To (1, 0.2) rgb <0.4, 0.2, 0>]
    [From (0, 1) To (1, 0.4) rgb From (0, <.2, .6, .3>) To (1, <.5, .3,
.1>)]
    [From (0, 1) To (1, 0.5) rgb <.95, .96, 1>]
    }

This example uses the Automatic Clock Modifier macros
(http://www.geocities.com/ccolefax) to create a (very simplified) seasonal
change, the middle green section changing to brown and snow appearing from
above (when used as a gradient).  Any functions of the clock could be used
to create very complex, shifting colours.

For image-maps, or indeed colour maps, you can use the average pattern to
blend between two pigments/textures, e.g. (again using the macro file):

Texture_From (0, SummerTexture)
    To (0.25, AutumnTexture)
    To (0.5, WinterTexture)
    To (0.75, SpringTexture)
    To (1, SummerTexture)


Post a reply to this message

From: Mitchell Waite
Subject: Re: Animating Color Maps
Date: 11 Feb 2002 23:55:41
Message: <3c68a04d$1@news.povray.org>
Ah shucks I think I used the wrong term. I meant "image map" not color map.
I have this awesome targa bit map that I got which is an aerial shot of my
terrain taken from a plane. I can colorize it in a paint program. Then I
want to move successive versions of it on top of my wireframe height map in
POV. The color map idea wont' work for this approach at all. I need to know
if I can move bit maps in and out.

Mitch


"Chris Colefax" <chr### [at] tagpovrayorg> wrote in message
news:3c689db7@news.povray.org...
> Mitchell Waite <mit### [at] dnaicom> wrote:
> > Is there a way to animate a color map in POV Ray. In other words say I
> have
> > a terrain aerial map in color. I want to make an animation showing the
> color
> > of the trees going from green to brown and snow to appear. I can paint
up
> > different color maps but how would I get them to change in POV Ray?
>
> You can animate colour maps directly by adjusting their index and colour
> values using the clock, e.g.:
>
> color_map {
>     [From (0, 0.1) To (1, 0.2) rgb <0.4, 0.2, 0>]
>     [From (0, 1) To (1, 0.4) rgb From (0, <.2, .6, .3>) To (1, <.5, .3,
> .1>)]
>     [From (0, 1) To (1, 0.5) rgb <.95, .96, 1>]
>     }
>
> This example uses the Automatic Clock Modifier macros
> (http://www.geocities.com/ccolefax) to create a (very simplified) seasonal
> change, the middle green section changing to brown and snow appearing from
> above (when used as a gradient).  Any functions of the clock could be used
> to create very complex, shifting colours.
>
> For image-maps, or indeed colour maps, you can use the average pattern to
> blend between two pigments/textures, e.g. (again using the macro file):
>
> Texture_From (0, SummerTexture)
>     To (0.25, AutumnTexture)
>     To (0.5, WinterTexture)
>     To (0.75, SpringTexture)
>     To (1, SummerTexture)
>
>
>


Post a reply to this message

From: Warp
Subject: Re: Animating Color Maps
Date: 12 Feb 2002 07:43:13
Message: <3c690de1@news.povray.org>
Then what you are looking for is something like this:

pigment
{ average pigment_map
  { [1-clock image_map { ... }]
    [clock image_map { ... }]
  }
}


-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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