POV-Ray : Newsgroups : povray.animations : Fading animations Server Time
2 May 2024 20:15:26 EDT (-0400)
  Fading animations (Message 1 to 10 of 10)  
From: Leroy
Subject: Fading animations
Date: 25 Nov 2007 22:42:24
Message: <474A4067.80406@joplin.com>
I've been playing with fading one animation into another.
And, made a little system that takes a frame from each animation and use 
pigment pattern to fade from one to another.
Is there any interest in it?

The basic INC has around 12 variable. So I've made a few INC's that 
predefine the variables to do special things. The Idea is that one can 
have a lot of different fades without have to remember all those 
variables.


Post a reply to this message

From: Leef me
Subject: Re: Fading animations
Date: 25 Nov 2007 23:25:00
Message: <web.474a49d0d5637c08892adb1d0@news.povray.org>
Leroy <lrw### [at] joplincom> wrote:
> I've been playing with fading one animation into another.
> And, made a little system that takes a frame from each animation and use
> pigment pattern to fade from one to another.
> Is there any interest in it?
>
> The basic INC has around 12 variable. So I've made a few INC's that
> predefine the variables to do special things. The Idea is that one can
> have a lot of different fades without have to remember all those
> variables.


> Is there any interest in it?

Is this a trick question? Of course there is interest.
You do realize by posting this thread that you are now under
obligation to post a sample result?  ;)

Leef_me


Post a reply to this message

From: Stephen
Subject: Re: Fading animations
Date: 26 Nov 2007 09:30:00
Message: <web.474ad802d5637c08726bd13c0@news.povray.org>
Leroy <lrw### [at] joplincom> wrote:
> I've been playing with fading one animation into another.
> And, made a little system that takes a frame from each animation and use
> pigment pattern to fade from one to another.
> Is there any interest in it?
>
> The basic INC has around 12 variable. So I've made a few INC's that
> predefine the variables to do special things. The Idea is that one can
> have a lot of different fades without have to remember all those
> variables.

No, who would want a simple method to fade from one scene to another?
:)
Of course it is of interest. Please post.
Pretty please. :)


Stephen


Post a reply to this message

From: Leroy
Subject: Re: Fading animations
Date: 26 Nov 2007 23:28:14
Message: <474B9CA2.1040505@joplin.com>
HERE IT IS!! The base any way.

This is the Fade.inc file:
//Fade one animation into another
// Vers: 3.6
// Auth: Leroy Whetstone Email lrw### [at] joplincom
// imagmaps at <0,0,0>
// Fade_Style:
//          0= animation1 Fade to animation2 uses average
//          1= animation2 Fade to animation1 uses average
//          2= pattern animation1 Cut to animation2
//          3= reverse pattern animation1 Cut to animation2
//          4= pattern animation2 Cut to animation1
//          5= reverse pattern animation2 Cut to animation1


#local ER=0;
#ifndef(Fade_Debug) #declare Fade_Debug=0;#end//show debugs
#ifndef(Fade_Style) #declare Fade_Style=0;#end//fade type
#ifndef(Fade_Pat_Deta) #declare Fade_Pat_Deta=0;#end//Blend area : space 
between images
#ifndef(Fade_Pat_Loc) #declare Fade_Pat_Loc=0;#end//Lock pattern at 
value 0<VALUE<=1
#ifndef(Fade_Pat) #declare Fade_Pat=pigment{gradient y translate 
y*.5};#end//pattern fade;
  // #declare Fade_Color=pigment{Black}//comment out to use sceneB
#ifndef(Subset_Start) #declare Subset_Start=0;#end//Subset_Start_Frame 
adjustment
#ifndef(Subset_End) #declare Subset_End=0;#end //use Subset_End_Frame 
for calc >0 yes 0=no;

#ifndef(Scene_Ambient) #declare Scene_Ambient=1; #end

#ifndef(SceneA1) #local ER=1; #end //Start First Scene file
#ifndef(SceneA2) #local ER=ER+2; #end//End First Scene file
#ifndef(Fade_Color)
  #ifndef(SceneB1)#local ER=ER+4;#end//Start second Scene file
  #ifndef(SceneB2)#local ER=ER+8;#end//End second Scene file
#end
#ifndef(Scene_Size) #local ER=ER+16; #debug "\nNeed Sv:Scenes 
size\n"#end// Scenes size
  #local Sv=<0,0,1>+Scene_Size;
#if(ER)
    #debug "\n.............ERROR!!! in FadeS3.pov............\n\n"
   #if(mod(ER,2)) #debug "Need SceneA1: Start First Scene file\n" #end
  #local ER=int(ER/2);
   #if(mod(ER,2)) #debug "Need SceneA2: End First Scene file\n" #end
  #local ER=int(ER/2);
   #if(mod(ER,2)) #debug "Need Fade_Color or SceneB1: Start second Scene 
file\n"#end
  #local ER=int(ER/2);
   #if(mod(ER,2)) #debug "Need Fade_Color or SceneB2: End second Scene 
file\n" #end
  #local ER=int(ER/2);
   #if(mod(ER,2)) #debug "Need Sv: Scenes Size\n" #end
  #debug "\n ...........ERROR!!! in FadeS3.pov.............\n\n"
#error "Stopped"
#end

camera{ location <0,0,-10>
         look_at <0,0,0>
         right x*image_width/image_height
         }

//================================================================
#macro FixVal(Scene) // fix name,id,type
  #local A=1;
  #local B=0;
  #local C=strlen(Scene);
  #local D=0;

  #while(B=0)
   #local N=substr(Scene,A,1);
   #if(strcmp(N,"0")=0) #local B=A; #end
   #if(val(N)>0) #local B=A; #end
   #local A=A+1;
   //#debug concat(D," A=",str(A,3,3),"  ",str(B,3,3),"\n")
   #if (A>C) #debug concat("\n**** Error: __",Scene,"__ number not right 
***\n\n")
    #error "Scene number not right"
   #end
  #end

  #while(D=0)
   #local N=substr(Scene,A,1);
   #if(strcmp(N,".")=0) #local D=A; #end
   #local A=A+1;
   //#debug concat(D," A=",str(A,3,3),"  ",str(B,3,3),"\n")
   #if (A>C) #debug concat("\n**** Error: __",Scene,"__ Type not right 
***\n\n")
    #error "Scene Type not right"
   #end
  #end

  #declare Sname=substr(Scene,1,B-1);
  #declare Stype=substr(Scene,D+1,3)
  #declare Sid=D-B;
  #declare Fdata=val(substr(Scene,B,Sid));
  //#debug concat(N," C=",str(D,3,3),"  ",str(B,3,3),"  ",str(Sid,3,3)," 
  ",str(Fdata,3,3),"\n")
#end

//=====================================================================
  #ifdef(Fade_Color)//replace SceneB with Fade_Color
   #declare Fade_Use_Color=1;//replace SceneB with Fade_Color
  #else
   #declare Fade_Use_Color=0;//replace SceneB with Fade_Color
  #end

FixVal(SceneA1)
  #declare Name1=Sname;
  #declare Type1=Stype;
  #declare IdS1=Sid;
  #declare Id1=Fdata;
FixVal(SceneA2)
  #declare Name2=Sname;
  #declare Type2=Stype;
  #declare IdS2=Sid;
  #declare Id2=Fdata;

#if(Fade_Use_Color=0)
  FixVal(SceneB1)
   #declare BName1=Sname;
   #declare BType1=Stype;
   #declare BIdS1=Sid;
   #declare BId1=Fdata;
  FixVal(SceneB2)
   #declare BName2=Sname;
   #declare BType2=Stype;
   #declare BIdS2=Sid;
   #declare BId2=Fdata;
  #end

#if(IdS1!=IdS2) #error "\n Not the right count\n" #end
#if(strcmp(Name1,Name2))#error "\n Not the right Names\n" #end
#if(strcmp(Type1,Type2))#error "\n Not the right Types\n" #end

#if(Fade_Use_Color=0)
  #if(BIdS1!=BIdS2) #error "\n Not the right count in second\n" #end
  #if(strcmp(BName1,BName2))#error "\n Not the right Names in second\n" #end
  #if(strcmp(BType1,BType2))#error "\n Not the right Types in second\n" #end

  #if((BId2-BId1)!=(Id2-Id1)) #error "\n Not the right count between 
Frist & second\n" #end
#end

#if(Subset_End=0)#local frame_End=final_frame;
#else #local frame_End=Subset_End;
#end
#if(Subset_Start=0)#local frame_Start=initial_frame;
#else #local frame_Start=Subset_Start;
#end

#local Rfd=frame_End-frame_Start;// initial_frame-Subset_Start;
#local Fd=(Id2-Id1);
#if(Fd!=Rfd)
   #debug concat("\n Rfd=",str(Rfd,3,3),"  Fd=",str(Fd,3,3),"\n")
   #debug "***   ERROR: Frame count and render Count don't match   ***\n"
   #debug concat("***               FIRST 
*** \n")
   #debug concat("***    SET INI initial frame to 0 
   ***\n")
   #debug concat("***    SET INI   final frame to ",str(Fd,2,0)," 
           ***\n\n")
   #error "Stoped"
#end
#if(Fade_Use_Color=0)
  #local Fd=(BId2-BId1);
#if(Fd!=Rfd)
   #debug concat("\n Rfd=",str(Rfd,3,3),"  Fd=",str(Fd,3,3),"\n")
   #debug "***   ERROR: Frame count and render Count don't match   ***\n"
   #debug concat("***              SECOND 
*** \n")
   #debug concat("***    SET INI initial frame to 0 
   ***\n")
   #debug concat("***    SET INI   final frame to ",str(Fd,2,0)," 
           ***\n\n")
   #error "Stoped"
  #end
#end

#local Fc = Id1+frame_number-frame_Start;
//#while (Cnt <= Id2)
  #declare Pname=concat(Name1,str(Fc,-IdS1,0),".",Type1);
  #if(Fade_Debug) #debug concat(Pname,"\n")#end
//#local Cnt = Cnt+1;
//#end
#if(Fade_Use_Color=0)
  #local Fc = BId1+frame_number-frame_Start;
  #declare Qname=concat(BName1,str(Fc,-BIdS1,0),".",BType1);
  #if(Fade_Debug) #debug concat(Qname,"\n")#end
#end
#if(Fade_Use_Color=0)
#declare Pig2=pigment{image_map{
        #if(strcmp(Type2,"Gif")=0) gif #end
        #if(strcmp(Type2,"tga")=0) tga #end
        #if(strcmp(Type2,"iff")=0) iff #end
        #if(strcmp(Type2,"ppm")=0) pgm #end
        #if(strcmp(Type2,"png")=0) png #end
        #if(strcmp(Type2,"jpg")=0) jpeg #end
        #if(strcmp(Type2,"tif")=0) tiff #end
        #if(strcmp(Type2,"bmp")=0) sys #end
        Qname
        }
       translate <-.5,-.5,0>
       }

#else #declare Pig2=pigment{Fade_Color} // #error"Stop"
#end
#declare Pig1=pigment{image_map{
        #if(strcmp(Type1,"Gif")=0) gif #end
        #if(strcmp(Type1,"tga")=0) tga #end
        #if(strcmp(Type1,"iff")=0) iff #end
        #if(strcmp(Type1,"ppm")=0) pgm #end
        #if(strcmp(Type1,"png")=0) png #end
        #if(strcmp(Type1,"jpg")=0) jpeg #end
        #if(strcmp(Type1,"tif")=0) tiff #end
        #if(strcmp(Type1,"bmp")=0) sys #end
        Pname
        }
       translate <-.5,-.5,0>
       }

#local Cv1=(frame_End-frame_number);//-frame_Start;
#local Cv2=frame_number-frame_Start;
#if(Fade_Pat_Loc)
   #local Cv1=(frame_End-frame_Start)*Fade_Pat_Loc;
   #local Cv2=(frame_End-frame_Start)-Cv1;
#end
  #if(Fade_Debug)
  #debug concat("\n  frame_Start=",str(frame_Start,3,3)," 
frame_End=",str(frame_End,3,3),"\n")
  //#debug concat("\n Cv1=",str(Cv1,3,3),"  Cv2=",str(Cv2,3,3),"\n")
  #end
#local FPD=Fade_Pat_Deta;
#switch(Fade_Style)
  #case(0) #declare Pig3=pigment{average pigment_map{[Cv1 Pig1][Cv2 
Pig2]}} #break
  #case(1) #declare Pig3=pigment{average pigment_map{[Cv1 Pig2][Cv2 
Pig1]}}#break
  #case(2)
         #local Tv=Cv2/(Cv2+Cv1);#if(Tv=0)#local FPD=0;#end
         #if(Fade_Pat_Loc) #local Tv=Fade_Pat_Loc;#end
         #declare Fna=function{pigment{Fade_Pat}}
         #declare Pig3=pigment{function{Fna(x,y,z).gray}
                       pigment_map{[Tv Pig1][Tv+FPD Pig2]}}
        //#debug concat("\n Tv=",str(Tv,3,3),"\n")
         #break
  #case(3)
         #local Tv=Cv1/(Cv2+Cv1);#if(Tv=0)#local FPD=0;#end
         #if(Fade_Pat_Loc) #local Tv=Fade_Pat_Loc;#end
         #declare Fna=function{pigment{Fade_Pat}}
         #declare Pig3=pigment{function{Fna(x,y,z).gray}
                       pigment_map{[Tv Pig2][Tv+FPD Pig1]}}
        //#debug concat("\n Tv=",str(Tv,3,3),"\n")
         #break
  #case(4)
         #local Tv=Cv2/(Cv2+Cv1);#if(Tv=0)#local FPD=0;#end
         #if(Fade_Pat_Loc) #local Tv=Fade_Pat_Loc;#end
         #declare Fna=function{pigment{Fade_Pat}}
         #declare Pig3=pigment{function{Fna(x,y,z).gray}
                       pigment_map{[Tv Pig2][Tv+FPD Pig1]}}
        //#debug concat("\n Tv=",str(Tv,3,3),"\n")
         #break
  #case(5)
         #local Tv=Cv1/(Cv2+Cv1);#if(Tv=0)#local FPD=0;#end
         #if(Fade_Pat_Loc) #local Tv=Fade_Pat_Loc;#end
         #declare Fna=function{pigment{Fade_Pat}}
         #declare Pig3=pigment{function{Fna(x,y,z).gray}
                       pigment_map{[Tv Pig1][Tv+FPD Pig2]}}
        //#debug concat("\n Tv=",str(Tv,3,3),"\n")
         #break
  #case(6) #include"CustomFade.inc"
         #break
  #else #debug"\n *** Fade_Style not in range ***\n\n"
        #error"Stopped"
#end

box{<-.5,-.5,0>,<.5,.5,.1>pigment{Pig3}
      finish{ambient Scene_Ambient}
      scale Sv/20}
--------to use you need to call Fade.inc from this ---------------
#declare Fade_Style=0 fade_out //default
//#declare Fade_Style=1 fade_in
#declare SceneA1= first animation frames start
#declare SceneA2= first animation frames end
#declare SceneB1= first animation frame start
#declare SceneB2= first animation frame end
#declare Scene_Size= <width,height>


Post a reply to this message

From: Leroy
Subject: Re: Fading animations
Date: 26 Nov 2007 23:41:13
Message: <474B9FAD.8050702@joplin.com>
Some more info about fader.inc
  You need to set the INI file
  Initial_Frame=0
  Final_Frame= number of scene_frames
  Initial_Clock=0
  Final_Clock=1
and of course have the directory of the scenes in the Library_Path

Any feed back is good feed back so let me know what you think.

Have Fun!


Post a reply to this message

From: Charles C
Subject: Re: Fading animations
Date: 27 Nov 2007 02:07:13
Message: <474bc221@news.povray.org>
Leroy wrote:

> Any feed back is good feed back so let me know what you think.

I think you should add several sweeps and shrinking/growing squares and 
circles, other symbols etc (think hearts, spades) by way of, I suppose, 
the object pattern. :-)
Charles


Post a reply to this message

From: Leroy
Subject: Re: Fading animations
Date: 27 Nov 2007 10:51:46
Message: <474C3CD5.7090209@joplin.com>
Charles C wrote:


> I think you should add several sweeps and shrinking/growing squares and 
> circles, other symbols etc (think hearts, spades) by way of, I suppose, 
> the object pattern. :-)
> Charles

Thank for the feed back!

It's on the List.
  :) belive it or not I've play with shapes already.


Post a reply to this message

From: Leef me
Subject: Re: Fading animations
Date: 27 Nov 2007 17:10:01
Message: <web.474c94abd5637c082a7b15450@news.povray.org>
Leroy <lrw### [at] joplincom> wrote:
> Some more info about fader.inc
>   You need to set the INI file
>   Initial_Frame=0
>   Final_Frame= number of scene_frames
>   Initial_Clock=0
>   Final_Clock=1
> and of course have the directory of the scenes in the Library_Path
>
> Any feed back is good feed back so let me know what you think.
>
> Have Fun!

I looked through your code and am totally lost.
Can you provide an example?

Leef_me


Post a reply to this message

From: Leroy
Subject: Re: Fading animations
Date: 27 Nov 2007 22:18:59
Message: <474CDDE6.4080707@joplin.com>
Leef_me wrote:

> I looked through your code and am totally lost.
> Can you provide an example?
> 

I know it's a little messy right now.
But here's what I use to as test.

//testing FadeS3.inc
// Vers: 3.6
// Auth: Leroy Whetstone Email lrw### [at] joplincom
#include "colors.inc"
  #declare Fade_Style=1;//fade type
// #declare Custom_Fade="Cf_To_BW.inc";
// #declare Fade_Pat=pigment{image_map {tga "Bhoe.tga"} 
//translate<-.5,-.5,0>};//pattern fade;
// #declare Fade_Pat=pigment{gradient -x translate .5}
//#declare Fade_Pat_Deta=.2;//Blend area : space between images
//#declare Fade_Pat_Loc=.3;//Lock pattern at value 0<VALUE<=1
//#declare Fade_Pat_Float_Loc=-1;//Float Lock <0 to Loc 0 at Loc >0 from 
//Loc
#declare Fade_Color=pigment{rgb<.8,.6,.2>}//comment out to use sceneB
//#declare Fade_Ambient=<1,1,2>;
#declare Fade_Debug=yes;
  #declare SceneA1="Balls00.tga";//Start First Scene file
  #declare SceneA2="Balls24.tga";//End First Scene file
  #declare SceneB1="Kview02.tga";//Start second Scene file
  #declare SceneB2="Kview26.tga";//End second Scene file
  #declare Scene_Size=<320,200>; // Scenes size
// #declare Subset_Start=0;//Subset_Start_Frame adjustment
// #declare Subset_End=0; //use Subset_End_Frame for calc >0 yes 0=no;


//#include "Hearts2.inc"
#include "FadeS3.inc"


Post a reply to this message

From: Leroy
Subject: Re: Fading animations
Date: 18 Dec 2007 17:04:26
Message: <47684389.4070907@joplin.com>
Well, I got the fader better organized.
  It's on my web site:  http://leroywhetstone.s5.com/PovFiles.html

It's zip as LRfader.zip. I'd appreciate any comments.

Sorry it took so long. But with ice storms and threat of snow storms,
I had little time for testing and retesting all the things that go in to 
LRfader. I hope I simplfied it's use.

Have Fun!


Post a reply to this message

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