|
![](/i/fill.gif) |
camera {
orthographic
location <(4/3)/2, 0.5, -1>
look_at <(4/3)/2, 0.5, 0>
}
light_source {<1, 3, -5> color rgb 1}
#include "functions.inc"
#macro Monet (pigm, strokesX, strokesY)
#local widthX = 4/3;
#local heightY = 1;
#local cntX = 0;
#local cntY = 0;
#local lseed = seed(1000);
#local incrX = widthX/strokesX;
#local incrY = heightY/strokesY;
blob {
threshold 0.65
#while(cntX < strokesX)
#local cntY = 0;
#while(cntY < strokesY)
#declare currentPoint = <incrX*cntX, incrY*cntY, 0>;
#declare P = eval_pigment(pigm, <currentPoint.x, currentPoint.y,
0>);
#local T = texture{pigment{P} finish{ambient 0.4 phong 0.5}};
sphere {<0, 0, 0>, 1, 2
texture{T}
scale<1.6, 1, 1>
scale <1.6 * incrX, 1.25 * incrX, (1.25 * incrX) + (1.2 * incrX *
rand(lseed))>
scale 1 + (0.2 * rand(lseed))
rotate z*(-20 + (20 * rand(lseed)))
translate<currentPoint.x + (incrX*rand(lseed)), currentPoint.y +
(incrY*rand(lseed)), 0>
}
#local cntY = cntY + 1;
#end
#local cntX = cntX + 1;
#end
scale z*0.14
}
#end
#macro VanGogh (pigm, strokesX, strokesY)
#local widthX = 4/3;
#local heightY = 1;
#local cntX = 0;
#local cntY = 0;
#local lseed = seed(1000);
#local incrX = widthX/strokesX;
#local incrY = heightY/strokesY;
#while(cntX < strokesX)
#local cntY = 0;
#while(cntY < strokesY)
#declare currentPoint = <incrX*cntX, incrY*cntY, 0>;
#if(cntY >= (strokesY - 5))
#declare P1 = eval_pigment(pigm, <currentPoint.x, currentPoint.y,
0>);
#declare P2 = eval_pigment(pigm, <currentPoint.x, currentPoint.y -
incrY*1, 0>);
#declare P3 = eval_pigment(pigm, <currentPoint.x, currentPoint.y -
incrY*2, 0>);
#declare P4 = eval_pigment(pigm, <currentPoint.x, currentPoint.y -
incrY*3, 0>);
#declare P5 = eval_pigment(pigm, <currentPoint.x, currentPoint.y -
incrY*4, 0>);
#else
#declare P1 = eval_pigment(pigm, <currentPoint.x, currentPoint.y,
0>);
#declare P2 = eval_pigment(pigm, <currentPoint.x, currentPoint.y +
incrY*1, 0>);
#declare P3 = eval_pigment(pigm, <currentPoint.x, currentPoint.y +
incrY*2, 0>);
#declare P4 = eval_pigment(pigm, <currentPoint.x, currentPoint.y +
incrY*3, 0>);
#declare P5 = eval_pigment(pigm, <currentPoint.x, currentPoint.y +
incrY*4, 0>);
#end
#local T1 = texture{pigment{P1} finish{ambient 0.4 phong 0.5}};
#local T2 = texture{pigment{P2} finish{ambient 0.4 phong 0.5}};
#local T3 = texture{pigment{P3} finish{ambient 0.4 phong 0.5}};
#local T4 = texture{pigment{P4} finish{ambient 0.4 phong 0.5}};
#local T5 = texture{pigment{P5} finish{ambient 0.4 phong 0.5}};
blob {
threshold 0.65
sphere { <0, 0, 0>, 1, 2 scale<5, 1, 1> texture{T5} translate<1, 0,
1.4>}
sphere { <0, 0, 0>, 1, 2 scale<5, 1, 1> texture{T4} translate<2, 0,
0.7>}
sphere { <0, 0, 0>, 1, 2 scale<5, 1, 1> texture{T3}}
sphere { <0, 0, 0>, 1, 2 scale<5, 1, 1> texture{T2} translate<3, 0,
-0.6>}
sphere { <0, 0, 0>, 1, 2 scale<4, 1, 1> texture{T1} translate<0.8,
0, -1.2>}
rotate -x*90
scale<0.4 * incrX, 0.4 * incrX, 0.001 + (0.001 * rand(lseed))>
rotate z*(-5 + (30 * rand(lseed)))
translate<currentPoint.x + (incrX*rand(lseed)), currentPoint.y +
(incrY*rand(lseed)), 0>
}
#local cntY = cntY + 1;
#end
#local cntX = cntX + 1;
#end
#end
#macro Signac (pigm, strokesX, strokesY)
#local widthX = 4/3;
#local heightY = 1;
#local cntX = 0;
#local cntY = 0;
#local lseed = seed(1000);
#local incrX = widthX/strokesX;
#local incrY = heightY/strokesY;
#while(cntX < strokesX)
#local cntY = 0;
#while(cntY < strokesY)
#declare currentPoint = <incrX*cntX, incrY*cntY, 0>;
#declare P = eval_pigment(pigm, <currentPoint.x, currentPoint.y, 0>);
#local T = texture{pigment{P} finish{ambient 0.4 phong 0.5}};
sphere{0, 2
texture{T}
scale<0.45 * incrX, 0.45 * incrX, 0.0002 + (0.0002 * rand(lseed))>
translate<currentPoint.x + (incrX*rand(lseed)), currentPoint.y +
(incrY*rand(lseed)), 0>
}
#local cntY = cntY + 1;
#end
#local cntX = cntX + 1;
#end
#end
#macro Picasso (pigm, strokesX, strokesY)
#local widthX = 4/3;
#local heightY = 1;
#local cntX = 0;
#local cntY = 0;
#local lseed = seed(1000);
#local incrX = widthX/strokesX;
#local incrY = heightY/strokesY;
#while(cntX < strokesX)
#local cntY = 0;
#while(cntY < strokesY)
#declare currentPoint = <incrX*cntX, incrY*cntY, 0>;
#declare P = eval_pigment(pigm, <currentPoint.x, currentPoint.y, 0>);
#local T = texture{pigment{P} finish{ambient 0.4 phong 0.5}};
box{-1, 1
texture{T}
scale<0.9 * incrX, 0.9 * incrX, 0.002 + (0.002 * rand(lseed))>
translate<currentPoint.x, currentPoint.y, 0>
}
#local cntY = cntY + 1;
#end
#local cntX = cntX + 1;
#end
#end
#macro Mondrian (pigm, strokesX, strokesY)
#local widthX = 4/3;
#local heightY = 1;
#local cntX = 0;
#local cntY = 0;
#local lseed = seed(1000);
#local incrX = widthX/strokesX;
#local incrY = heightY/strokesY;
#while(cntX < strokesX)
#local cntY = 0;
#while(cntY < strokesY)
#declare currentPoint = <incrX*cntX, incrY*cntY, 0>;
#declare P = eval_pigment(pigm, <currentPoint.x, currentPoint.y, 0>);
#local T = texture{pigment{P} finish{ambient 1 diffuse 0 phong
0.5}};
union {
difference{
box{-1.1, 1.1}
box{<-1, -1, -2>, <1, 1, 2>}
pigment{color rgb 0}
finish{ambient 0.4 phong 0.5}
}
box{-1.01, 1.01
texture{T}
}
scale<1.2 * incrX, 1.2 * incrY, 0.01 * rand(lseed)>
translate<currentPoint.x, currentPoint.y, 0>
}
#local cntY = cntY + 1;
#end
#local cntX = cntX + 1;
#end
#end
#macro Pollock (pigm, strokesX, strokesY)
#local widthX = 4/3;
#local heightY = 1;
#local cntX = 0;
#local cntY = 0;
#local lseed = seed(1000);
#local incrX = widthX/strokesX;
#local incrY = heightY/strokesY;
blob {
threshold 0.65
#while(cntX < strokesX)
#local cntY = 0;
#while(cntY < strokesY)
#declare currentPoint = <incrX*cntX, incrY*cntY, 0>;
#declare P = eval_pigment(pigm, <currentPoint.x, currentPoint.y,
0>);
#local T = texture{pigment{P} finish{ambient 0.4 phong 0.5}};
cylinder {<-1, 0, 0>, <1, 0, 0>, 1, 2
texture{T}
scale <2.5 * incrX, 0.6 * incrX, (0.6 * incrX) + (0.04 *
rand(lseed))>
rotate z*360*rand(lseed)
translate<currentPoint.x + (incrX*rand(lseed)), currentPoint.y +
(incrY*rand(lseed)), 0>
}
#local cntY = cntY + 1;
#end
#local cntX = cntX + 1;
#end
scale z*0.2
}
#end
#macro Lichtenstein (pigm, strokesX, strokesY, bw)
#local widthX = 4/3;
#local heightY = 1;
#local cntX = 0;
#local cntY = 0;
#local lseed = seed(1000);
#local incrX = widthX/strokesX;
#local incrY = heightY/strokesY;
#while(cntX < strokesX)
#local cntY = 0;
#while(cntY < strokesY)
#declare currentPoint = <incrX*cntX, incrY*cntY, 0>;
#declare P = eval_pigment(pigm, <currentPoint.x, currentPoint.y, 0>);
#declare C = (P.red + P.green + P.blue)/3;
#if(bw)
#local T = texture{pigment{color rgb 1} finish{ambient 1 diffuse
0}};
#else
#local T = texture{pigment{P} finish{ambient 1 diffuse 0}};
#end
cylinder{0, <0, 0, 0.2>, 0.5
texture{T}
scale C
scale<incrX, incrY, 1>
translate<incrX/2, incrY/2, 0>
translate<currentPoint.x, currentPoint.y, 0>
}
#local cntY = cntY + 1;
#end
#local cntX = cntX + 1;
#end
#end
#macro PovRay (pigm, strokesX, strokesY)
#local widthX = 4/3;
#local heightY = 1;
#local cntX = 0;
#local cntY = 0;
#local lseed = seed(1000);
#local incrX = widthX/strokesX;
#local incrY = heightY/strokesY;
#declare Stroke1 = difference {
box{<-0.5, -0.5, -0.5>, 0.5}
sphere{<0, 0, -0.5>, 0.5}
scale<1, 1, 0.6>
no_shadow
};
#declare Stroke2 = sphere{0, 0.5 scale<1, 1, 0.4> no_shadow};
#declare Stroke3 = torus{0.3, 0.2 rotate x*90 scale<1, 1, 0.6>
no_shadow};
#declare Stroke4 = cone{0, 0.5, <0, 0, -0.5>, 0 scale<1, 1, 0.5>};
#declare Stroke5 = cylinder{<-0.5, 0, 0>, <0.5, 0, 0>, 0.5 scale<1, 1,
0.6> no_shadow};
#declare Stroke6 = cylinder{<0, -0.5, 0>, <0, 0.5, 0>, 0.5 scale<1, 1,
0.6> no_shadow};
#declare Stroke7 = cone{0, 0.5, <0, 0, -0.5>, 0.3 scale<1, 1, 0.4>};
#declare Stroke8 = union {
cylinder{<-0.5, 0, 0>, <0.5, 0, 0>, 0.25 scale<1, 1, 0.6> translate
y*0.25 no_shadow}
cylinder{<-0.5, 0, 0>, <0.5, 0, 0>, 0.25 scale<1, 1, 0.6> translate
-y*0.25 no_shadow}
};
#declare Stroke9 = union {
cylinder{<0, -0.5, 0>, <0, 0.5, 0>, 0.25 scale<1, 1, 0.6> translate
-x*0.25 no_shadow}
cylinder{<0, -0.5, 0>, <0, 0.5, 0>, 0.25 scale<1, 1, 0.6> translate
x*0.25 no_shadow}
};
#declare Stroke10 = union {
torus{0.375, 0.125 rotate x*90 scale<1, 1, 0.6> no_shadow}
torus{0.125, 0.125 rotate x*90 scale<1, 1, 0.6> no_shadow}
};
#while(cntX < strokesX)
#local cntY = 0;
#while(cntY < strokesY)
#declare currentPoint = <incrX*cntX, incrY*cntY, 0>;
#declare P = eval_pigment(pigm, <currentPoint.x, currentPoint.y, 0>);
#local T = texture{pigment{P} finish{ambient 0.3 phong 0}};
#local lnum = rand(lseed);
#if(lnum <= 0.1)
#local CurrentStroke = Stroke1;
#end
#if(lnum <= 0.2 & lnum > 0.1)
#local CurrentStroke = Stroke2;
#end
#if(lnum <= 0.3 & lnum > 0.2)
#local CurrentStroke = Stroke3;
#end
#if(lnum <= 0.4 & lnum > 0.3)
#local CurrentStroke = Stroke4;
#end
#if(lnum <= 0.5 & lnum > 0.4)
#local CurrentStroke = Stroke5;
#end
#if(lnum <= 0.6 & lnum > 0.5)
#local CurrentStroke = Stroke6;
#end
#if(lnum <= 0.7 & lnum > 0.6)
#local CurrentStroke = Stroke7;
#end
#if(lnum <= 0.8 & lnum > 0.7)
#local CurrentStroke = Stroke8;
#end
#if(lnum <= 0.9 & lnum > 0.8)
#local CurrentStroke = Stroke9;
#end
#if(lnum <= 1 & lnum > 0.9)
#local CurrentStroke = Stroke10;
#end
object {
CurrentStroke
texture{T}
scale incrX
translate<incrX/2, incrY/2, 0>
translate<currentPoint.x, currentPoint.y, 0>
}
#local cntY = cntY + 1;
#end
#local cntX = cntX + 1;
#end
#end
#declare tahoe = pigment {
image_map{
jpeg "tahoe.jpg"
map_type 0
interpolate 0
once
}
scale <4/3, 1, 1>
}
union {
//plane{-z, 0 pigment{tahoe} finish{ambient 0.4}}
//Monet(tahoe, 120, 90)
//VanGogh(tahoe, 120, 90)
//Signac(tahoe, 120, 90)
//Picasso(tahoe, 80, 60)
//Mondrian(tahoe, 40, 30)
//Pollock(tahoe, 120, 90)
//Lichtenstein(tahoe, 80, 60, 1)
PovRay(tahoe, 80, 60)
}
Post a reply to this message
|
![](/i/fill.gif) |