Code for Sine Wave Animation Rendered in POVRay

 // PoVRay 3.7 Scene File " ... .pov"

// author:  ...

// date:    ...

//--------------------------------------------------------------------------

#version 3.7;

global_settings{ assumed_gamma 1.0 }

#default{ finish{ ambient 0.1 diffuse 0.9 }} 

//--------------------------------------------------------------------------

#include "colors.inc"

#include "textures.inc"

#include "glass.inc"

#include "metals.inc"

#include "golds.inc"

#include "stones.inc"

#include "woods.inc"

#include "shapes.inc"

#include "shapes2.inc"

#include "functions.inc"

#include "math.inc"

#include "transforms.inc"

//---------------------------------------------------------------------------------

//---------------------------------------------------------------------------------

#declare Camera_Number = 0 ;

//---------------------------------------------------------------------------------

// camera -------------------------------------------------------------------------

#switch ( Camera_Number )

#case (0)

  #declare Camera_Location = < 0.00, 1.00, -3.00> ;  // front view

  #declare Camera_Look_At  = < 0.00, 1.00,  0.00> ;

  #declare Camera_Angle    =  75 ;

#break

#case (1)

  #declare Camera_Location =  < 2.0 , 2.5 ,-3.0> ;  // diagonal view

  #declare Camera_Look_At  =  < 0.0 , 1.0 , 0.0> ;

  #declare Camera_Angle    =  90 ;

#break

#case (2)

  #declare Camera_Location = < 3.0, 1.0 , 0.0> ;  // right side view

  #declare Camera_Look_At  = < 0.0, 1.0,  0.0> ;

  #declare Camera_Angle    =  90 ;

#break

#case (3)

  #declare Camera_Location = < 0.00, 5.00,  0+0.000> ;  // top view

  #declare Camera_Look_At  = < 0.00, 0.00,  0+0.001> ;

  #declare Camera_Angle    = 90 ;

#break

#else

  #declare Camera_Location = < 0.00, 1.00, -3.50> ;  // front view

  #declare Camera_Look_At  = < 0.00, 1.00,  0.00> ;

  #declare Camera_Angle    =  75 ;

#break

#break

#end // of "#switch ( Camera_Number )"  

//--------------------------------------------------------------------------

camera{ // ultra_wide_angle // orthographic 

        location Camera_Location

        right    x*image_width/image_height

        angle    Camera_Angle

        look_at  Camera_Look_At

      }

// sun ---------------------------------------------------------------------

light_source{< 3000,3000,-3000> color rgb<1,1,1>*0.9}                // sun 

light_source{ Camera_Location   color rgb<0.9,0.9,1>*0.1 shadowless}// flash

// sky ---------------------------------------------------------------------

sky_sphere { pigment { gradient <0,1,0>

                       color_map { [0.00 rgb <1.0,1.0,1.0>]

                                   [0.30 rgb < 0.486 , 0.769 , 1.000 >]

                                   [0.70 rgb < 0.486 , 0.769 , 1.000 >]

                                   [1.00 rgb <1.0,1.0,1.0>] 

                                 } 

                       scale 2         

                     } // end of pigment

           } //end of skysphere                        

// ground ------------------------------------------------------------------

/*

plane{ <0,1,0>, 0 

       texture{ pigment{ color rgb <0.7,0.5,0.3>}

              //normal { bumps 0.75 scale 0.025}

                finish { phong 0.1}

              } // end of texture

     } // end of plane

*/

//--------------------------------------------------------------------------

//---------------------------- objects in scene ----------------------------

//--------------------------------------------------------------------------


/*text { ttf "arial.ttf", "pure white background", 0.02, 0.0 // thickness, offset

       texture{ pigment{ color rgb<1,0.6,0>*0.5 } 

                finish { phong 0.1 }

              } // end of texture


       scale<1,1.25,1>*0.43

       translate<-2.10,-0.30,0.00 >

      } // end of text object ---------------------------------------------*/



#declare Circmov=clock*360;

#declare Counter=0;

#declare Circh=-1.5;

#declare Circk=1;

#declare Circr=0.5;

#declare Wavex=-0.5;

#declare Wavey=1;

#declare Wavemult=2/360; 


torus { 0.50,0.025

        texture { T_Gold_5A

                } // end of texture

        scale <1,1,1> rotate<90,0,0> translate<-1.5,1,0>

      } // end of torus    

      

      

cylinder { <3,1,0>,<-3,1,0>, 0.01

           texture { pigment { color rgb<0,0,0>}

                   //normal  { bumps 0.5 scale <0.25, 0.005,0.005>}  

                     finish  { phong 0.5 reflection{ 0.00 metallic 0.00} } 

                   } // end of texture

           scale <1,1,1> rotate<0,0,0> translate<0,0,0>

         } // end of cylinder

         

         

cylinder { <-1.5,3,0>,<-1.5,-3,0>, 0.01

           texture { pigment { color rgb<0,0,0>}

                   //normal  { bumps 0.5 scale <0.25, 0.005,0.005>}  

                     finish  { phong 0.5 reflection{ 0.00 metallic 0.00} } 

                   } // end of texture

           scale <1,1,1> rotate<0,0,0> translate<0,0,0>

         } // end of cylinder                     

      

      

 sphere { <0,0,0>, 0.06 


         texture { pigment{ color Red } // rgb< 1, 0.55, 0.0>}

                   finish { phong 1 reflection{ 0.00 metallic 0.00} }

                 } // end of texture 


          scale<1,1,1>  rotate<0,0,0>  translate<Circr*cos(radians(Circmov))+Circh,Circr*sin(radians(Circmov))+Circk,-0.015> 

                 }  // end of sphere ----------------------------------- 

                 

 sphere { <0,0,0>, 0.06 


         texture { pigment{ color Red } // rgb< 1, 0.55, 0.0>}

                   finish { phong 1 reflection{ 0.00 metallic 0.00} }

                 } // end of texture 


          scale<1,1,1>  rotate<0,0,0> translate<(Circmov*Wavemult)+Wavex,sin(radians(Circmov))*Circr+Wavey,-0.015>

          

                 }  // end of sphere -----------------------------------        

          

                 

                 

cylinder { <Circr*cos(radians(Circmov))+Circh,Circr*sin(radians(Circmov))+Circk,-0.015>,<(Circmov*Wavemult)+Wavex,sin(radians(Circmov))*Circr+Wavey,-0.015>, 0.02

           texture { pigment { color rgb<1,1,1>*0.15}

                   //normal  { bumps 0.5 scale <0.25, 0.005,0.005>}  

                     finish  { phong 0.5 reflection{ 0.00 metallic 0.00} } 

                   } // end of texture

           scale <1,1,1> rotate<0,0,0> translate<0,0,0>

         } // end of cylinder           

                 

                 


#while(Counter<Circmov)

sphere { <0,0,0>, 0.020 


         texture { pigment{ color <1,1,1>*0.25 } // rgb< 1, 0.55, 0.0>}

                   finish { phong 1 reflection{ 0.00 metallic 0.00} }

                 } // end of texture 


          scale<1,1,1>  rotate<0,0,0> translate<(Counter*Wavemult)+Wavex,sin(radians(Counter))*Circr+Wavey,0>

                 }  // end of sphere ----------------------------------- 

                 

                 


    #declare Counter=Counter+1;

    

    #end     

Comments