POV-Ray : Newsgroups : povray.text.scene-files : distortion_field source code Server Time
1 Nov 2024 11:15:45 EDT (-0400)
  distortion_field source code (Message 1 to 2 of 2)  
From: Chris Huff
Subject: distortion_field source code
Date: 25 Jun 2000 11:27:12
Message: <chrishuff-615925.10314025062000@news.povray.org>
//  Persistence of Vision Ray Tracer Scene Description File
//  File: 3dHF.pov
//  Date: 
//  Author: Chris Huff
//   
//   *******************************************
//   -------------------------------------------
#include "colors.inc"
#include "textures.inc"
#version unofficial MegaPov 0.5;
//-------------------------------------------
global_settings {
    assumed_gamma 1.8
}

#declare CamLoc = vtransform(<2, 2.5,-8>, rotate y*15);
camera {
    location CamLoc
    up y*image_height right x*image_width
    angle 25
    look_at <0, 1, 0>
}

box {<-100, 0,-100>, < 100, 0, 100>
    texture {
        pigment {White*0.85}
        finish {
            reflection 0.15
            reflect_metallic
            conserve_energy
        }
    }
}
//*******************************************
#declare rsA = seed(7582);
#declare rsB = seed(4385);
#declare rsC = seed(6543);
#declare rsD = seed(8538);
#declare rsE = seed(5235);

#macro pmRand(RS)
    (rand(RS)*2-1)
#end
#macro gRand(RS)
    ((rand(RS)+rand(RS)+rand(RS))/3)
#end
#macro gpmRand(RS)
    (gRand(RS)*2-1)
#end

#declare controlPgmt =
//pigment {wood
//pigment {wrinkles
pigment {crackle//bozo
    phase clock
    color_map {
//      [0 color rgb <1,1,1>]
//      [1 color rgb <-1,-1,-1>]
        #declare K=0;
        #declare L=6;
        #while(K<L)
            [(K/(L-1)) color rgb < pmRand(rsA), pmRand(rsA), 
pmRand(rsA)>]
            #declare K=K+1;
        #end
    }
//  scale 0.75
}

#declare CubeSize = < 15, 15, 5>;
#declare DispScale = 1;

#declare Grid =
union {
    #declare J=0;
    #while(J<CubeSize.x)
        #declare K=0;
        #while(K<CubeSize.y)
            #declare L=0;
            #while(L<CubeSize.z)
                #declare PosA = < J, K, L>;
                #declare PosB = < J+1, K, L>;
                #declare PosC = < J, K+1, L>;
                #declare PosD = < J, K, L+1>;
                #declare PosA = PosA+DispScale*eval_pigment(controlPgmt 
scale CubeSize, PosA);
                #declare PosB = PosB+DispScale*eval_pigment(controlPgmt 
scale CubeSize, PosB);
                #declare PosC = PosC+DispScale*eval_pigment(controlPgmt 
scale CubeSize, PosC);
                #declare PosD = PosD+DispScale*eval_pigment(controlPgmt 
scale CubeSize, PosD);
                sphere {PosA, 0.2
                    texture {
                        pigment {color rgb eval_pigment(controlPgmt 
scale CubeSize, PosA)*0.5+0.5}
                        finish {ambient 0.7}
                    }
                }
                #if(J!=CubeSize.x-1)
                    cylinder {PosA, PosB, 0.1}
                #end
                #if(K!=CubeSize.y-1)
                    cylinder {PosA, PosC, 0.1}
                #end
                #if(L!=CubeSize.z-1)
                    cylinder {PosA, PosD, 0.1}
                #end
                
                #declare L=L+1;
            #end
            #declare K=K+1;
        #end
        #declare J=J+1;
    #end
    texture {
        pigment {color White}
    }
}
object {Grid
    scale 1/max(CubeSize.x, max(CubeSize.y, CubeSize.z))//scale to about 
unit-size
    translate <-0.5, 0.2,-0.5>
    rotate y*35
    scale 2
}
//*******************************************

light_source {<-20, 150, -100> color White}
light_source {CamLoc color White*0.3}

light_source {< 10, 40, 80> color White*0.3}

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

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: up luino
Subject: R: distortion_field source code
Date: 25 Jun 2000 11:45:33
Message: <3956291d@news.povray.org>
OK.
Many thanks.
Aldo

Chris Huff <chr### [at] maccom> wrote in message
chrishuff-615925.10314025062000@news.povray.org...
> //  Persistence of Vision Ray Tracer Scene Description File
> //  File: 3dHF.pov
> //  Date:
> //  Author: Chris Huff
> //
> //   *******************************************
> //   -------------------------------------------
> #include "colors.inc"
> #include "textures.inc"
> #version unofficial MegaPov 0.5;
> file://-------------------------------------------
> global_settings {
>     assumed_gamma 1.8
> }
>
> #declare CamLoc = vtransform(<2, 2.5,-8>, rotate y*15);
> camera {
>     location CamLoc
>     up y*image_height right x*image_width
>     angle 25
>     look_at <0, 1, 0>
> }
>
> box {<-100, 0,-100>, < 100, 0, 100>
>     texture {
>         pigment {White*0.85}
>         finish {
>             reflection 0.15
>             reflect_metallic
>             conserve_energy
>         }
>     }
> }
> file://*******************************************
> #declare rsA = seed(7582);
> #declare rsB = seed(4385);
> #declare rsC = seed(6543);
> #declare rsD = seed(8538);
> #declare rsE = seed(5235);
>
> #macro pmRand(RS)
>     (rand(RS)*2-1)
> #end
> #macro gRand(RS)
>     ((rand(RS)+rand(RS)+rand(RS))/3)
> #end
> #macro gpmRand(RS)
>     (gRand(RS)*2-1)
> #end
>
> #declare controlPgmt =
> file://pigment {wood
> file://pigment {wrinkles
> pigment {crackle//bozo
>     phase clock
>     color_map {
> //      [0 color rgb <1,1,1>]
> //      [1 color rgb <-1,-1,-1>]
>         #declare K=0;
>         #declare L=6;
>         #while(K<L)
>             [(K/(L-1)) color rgb < pmRand(rsA), pmRand(rsA),
> pmRand(rsA)>]
>             #declare K=K+1;
>         #end
>     }
> //  scale 0.75
> }
>
> #declare CubeSize = < 15, 15, 5>;
> #declare DispScale = 1;
>
> #declare Grid =
> union {
>     #declare J=0;
>     #while(J<CubeSize.x)
>         #declare K=0;
>         #while(K<CubeSize.y)
>             #declare L=0;
>             #while(L<CubeSize.z)
>                 #declare PosA = < J, K, L>;
>                 #declare PosB = < J+1, K, L>;
>                 #declare PosC = < J, K+1, L>;
>                 #declare PosD = < J, K, L+1>;
>                 #declare PosA = PosA+DispScale*eval_pigment(controlPgmt
> scale CubeSize, PosA);
>                 #declare PosB = PosB+DispScale*eval_pigment(controlPgmt
> scale CubeSize, PosB);
>                 #declare PosC = PosC+DispScale*eval_pigment(controlPgmt
> scale CubeSize, PosC);
>                 #declare PosD = PosD+DispScale*eval_pigment(controlPgmt
> scale CubeSize, PosD);
>                 sphere {PosA, 0.2
>                     texture {
>                         pigment {color rgb eval_pigment(controlPgmt
> scale CubeSize, PosA)*0.5+0.5}
>                         finish {ambient 0.7}
>                     }
>                 }
>                 #if(J!=CubeSize.x-1)
>                     cylinder {PosA, PosB, 0.1}
>                 #end
>                 #if(K!=CubeSize.y-1)
>                     cylinder {PosA, PosC, 0.1}
>                 #end
>                 #if(L!=CubeSize.z-1)
>                     cylinder {PosA, PosD, 0.1}
>                 #end
>
>                 #declare L=L+1;
>             #end
>             #declare K=K+1;
>         #end
>         #declare J=J+1;
>     #end
>     texture {
>         pigment {color White}
>     }
> }
> object {Grid
>     scale 1/max(CubeSize.x, max(CubeSize.y, CubeSize.z))//scale to about
> unit-size
>     translate <-0.5, 0.2,-0.5>
>     rotate y*35
>     scale 2
> }
> file://*******************************************
>
> light_source {<-20, 150, -100> color White}
> light_source {CamLoc color White*0.3}
>
> light_source {< 10, 40, 80> color White*0.3}
>
> //   -------------------------------------------
>
> --
> Christopher James Huff - Personal e-mail: chr### [at] maccom
> TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
> Personal Web page: http://homepage.mac.com/chrishuff/
> TAG Web page: http://tag.povray.org/


Post a reply to this message

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