|
|
// [GDS|Entropy]
//#include "slopeSnowTex.inc"
#version unofficial megapov 1.21;
global_settings {
assumed_gamma 1.0
}
camera {
location <-5, 4,16>
up y*image_height right x*image_width
look_at < 0, 1.5, 0>
angle 45
}
light_source {
0*x
color rgb <0.2734, 0.5078, 0.7031>
area_light
<100, 0, 0> <0, 0, 100>
4, 4
adaptive 0
jitter
translate <0,1000,-2000>
}
light_source {
0*x
color rgb <0.2734, 0.5078, 0.7031>
area_light
<100, 0, 0> <0, 0, 100>
4, 4
adaptive 0
jitter
translate <0,1000,2000>
}
#local RsA = seed(574647);
// RRand Macro by Chris Huff
#macro RRand(RS, Min, Max)
(rand(RS)*(Max-Min) + Min)
#end
// randVectorMM2 Macro by [GDS|Entropy]
//------
#macro randVectorMM2(Array,ctr,Min,Max,Object)
#local vectorA = min_extent(Object);
#local vectorB = max_extent(Object);
#local i=0;
#while (i<ctr)
#declare Array[i] = <RRand(RsA, Min+vectorA.x, Max+vectorB.x),RRand(RsA,
Min+vectorA.y, Max+vectorB.y),RRand(RsA, Min+vectorA.z, Max+vectorB.z)>;
#set i=i+1;
#end
#end
//------
//slopeSnowTex(-1,0.9)
// icicleVectTest Macro by [GDS|Entropy]
#macro
icicleVectTest(Array,ctr,vectorArray,testVector,testObject,lengthMult)
#local vectorA = min_extent(testObject);
#local vectorB = max_extent(testObject);
#local i=0;
#while (i<dimension_size(vectorArray,1))
#ifdef (vectorArray[i])
#if (((vectorArray[i].x <= vectorB.x) & (vectorArray[i].x >= vectorA.x))
& ((vectorArray[i].y <= vectorB.y) & (vectorArray[i].y >= vectorA.y)) &
((vectorArray[i].z <= vectorB.z) & (vectorArray[i].z >= vectorA.z)))
#local trace0 = trace(testObject,vectorArray[i],testVector);
#if (((trace0.x <= vectorB.x) & (trace0.x >= vectorA.x)) & ((trace0.y <=
vectorB.y) & (trace0.y >= vectorA.y)) & ((trace0.z <= vectorB.z) & (trace0.z
>= vectorA.z)))
#local k=0;
#while (k<(ctr*lengthMult))
#local icicleLength = vlength(<trace0.x+RRand(RsA, 0.125,
0.25)-0.25,-(trace0.y-(1*0.132)),trace0.z+RRand(RsA, 0.125,
0.25)-0.25>-<trace0.x+RRand(RsA, 0.125,
0.25)-0.25,-(trace0.y-((ctr*lengthMult)*0.132)),trace0.z+RRand(RsA, 0.125,
0.25)-0.25>);
#local icicleVectors = <trace0.x+RRand(RsA, 0.125,
0.25),-((trace0.y-(k*0.132))-(icicleLength-(1+RRand(RsA, 0.75,
0.85)))),trace0.z+RRand(RsA, 0.125, 0.25)>;
#if (inside(testObject,icicleVectors))
// Icicles aren't supposed to be inside things
#else
#declare Array[k] = icicleVectors;
sphere {icicleVectors, 0.5 pigment {color rgb 1}}
#end
#set k=k+1;
#end
#end
#end
#end
#set i=i+1;
#end
#end
//------
// snowVectTest Macro by [GDS|Entropy]
#macro snowVectTest(Array,Array0,ctr,vectorArray,testVector,testObject)
#local vectorA = min_extent(testObject);
#local vectorB = max_extent(testObject);
#local i=0;
#while (i<ctr)
#if (((vectorArray[i].x <= vectorB.x) & (vectorArray[i].x >= vectorA.x)) &
((vectorArray[i].y <= vectorB.y) & (vectorArray[i].y >= vectorA.y)) &
((vectorArray[i].z <= vectorB.z) & (vectorArray[i].z >= vectorA.z)))
#if (inside(testObject,vectorArray[i]))
#declare Array[i] = trace(testObject,vectorArray[i],testVector);
#end
#end
#set i=i+1;
#end
#end
//------
// GDSXsnowTest Macro by [GDS|Entropy]
#macro
GDSXsnowTest(snowCounter,icicleCounter,testVector,testObject,useInterior,sRadVal,sStrVal,sFudgeFactor,iRadVal,iStrVal,iFudgeFactor,iLengthMult)
#local icicleVect = <testVector.x,-testVector.y,testVector.z>;
#declare sRandVectArray = array [snowCounter];
#declare iRandVectArray = array [icicleCounter];
randVectorMM2(sRandVectArray,snowCounter,-sFudgeFactor,sFudgeFactor,testObject)
#declare snowVectArray = array [snowCounter]; #declare icicleVectArray = array
[icicleCounter];
snowVectTest(snowVectArray,iRandVectArray,snowCounter,sRandVectArray,testVector,testObject)
icicleVectTest(icicleVectArray,icicleCounter,snowVectArray,icicleVect,testObject,iLengthMult)
/* blob { #local i=0; #while (i<dimension_size(snowVectArray,1)) #ifdef
(snowVectArray[i]) sphere { snowVectArray[i], sRadVal-RRand(RsA, 0.125, 0.25),
sStrVal pigment {color rgb snowVectArray[i]} } #end #set i=i+1; #end
#local k=0; #while (k<dimension_size(icicleVectArray,1)) #ifdef
(icicleVectArray[k]) sphere {
icicleVectArray[k],iRadVal+((cos(k)*atan(0.125*sqrt(abs(k))))-RRand(RsA, 0.25, 0.5)),
iStrVal pigment {color rgb icicleVectArray[k]} } #end #set k=k+1; #end #if
(useInterior) interior { fade_distance 2 fade_power 3 ior 1.45 caustics 1.0
} #end }*/#end//------// test objects#declare objA =torus { 1, 0.5 translate
<0,0,0> rotate <90,0,0> scale 2}#declare objB =cone { <0, 1, 0>, 0.0, <0, -1, 0>, 1.0
scale 2}#declare objC =quartic { < 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0,
0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, -0.01 >
bounded_by { sphere { <0, 0, 0>, 2 } } scale 2}//------#declare sno = 500;#declare
ice = 50;union
{//GDSXsnowTest(snowCounter,icicleCounter,testVector,testObject,useInterior,sRadVal,sStrVal,sFudgeFactor,iRadVal,iStrVal,iFudgeFactor,iLengthMult)
GDSXsnowTest(sno,ice,<0,12,0>,objA,no,1,1,0,1,0.5,4,0.125) object { objA texture {
pigment { color rgbt 0.7 } } }}
Post a reply to this message
|
|