From eddbcf6f6595701fcb85bfc8b5c07842ed7cadab Mon Sep 17 00:00:00 2001 From: hjp Date: Mon, 23 Aug 2010 17:28:21 +0000 Subject: [PATCH] Applied some very old changes found on teal --- pr/posbi/posbi.pov | 106 +++++++++++++++++++--------------------- pr/posbi/test-mesh.pov | 2 +- pr/posbi/test-posbi.pov | 7 ++- 3 files changed, 57 insertions(+), 58 deletions(-) diff --git a/pr/posbi/posbi.pov b/pr/posbi/posbi.pov index 8fb5293..54d7d94 100644 --- a/pr/posbi/posbi.pov +++ b/pr/posbi/posbi.pov @@ -2,62 +2,58 @@ #local R1 = 1000; #local R2 = 0; -#local C = array[2][2][2] { - { - { - <-R1 + R2 * (rand(RND1)*2-1), -R1 + R2 * (rand(RND1)*2-1), -R1 + R2 * (rand(RND1)*2-1)>, - <-R1 + R2 * (rand(RND1)*2-1), -R1 + R2 * (rand(RND1)*2-1), +R1 + R2 * (rand(RND1)*2-1)>, - }, - { - <-R1 + R2 * (rand(RND1)*2-1), +R1 + R2 * (rand(RND1)*2-1), -R1 + R2 * (rand(RND1)*2-1)>, - <-R1 + R2 * (rand(RND1)*2-1), +R1 + R2 * (rand(RND1)*2-1), +R1 + R2 * (rand(RND1)*2-1)>, - }, - } - { - { - <+R1 + R2 * (rand(RND1)*2-1), -R1 + R2 * (rand(RND1)*2-1), -R1 + R2 * (rand(RND1)*2-1)>, - <+R1 + R2 * (rand(RND1)*2-1), -R1 + R2 * (rand(RND1)*2-1), +R1 + R2 * (rand(RND1)*2-1)>, - }, - { - <+R1 + R2 * (rand(RND1)*2-1), +R1 + R2 * (rand(RND1)*2-1), -R1 + R2 * (rand(RND1)*2-1)>, - <+R1 + R2 * (rand(RND1)*2-1), +R1 + R2 * (rand(RND1)*2-1), +R1 + R2 * (rand(RND1)*2-1)>, - }, - } -}; -#declare posbi = mesh2 { - vertex_vectors { - 14, - C[0][0][0], - C[0][0][1], - C[0][1][0], - C[0][1][1], - C[1][0][0], - C[1][0][1], - C[1][1][0], - C[1][1][1], - (C[0][0][0] + C[0][0][1] + C[0][1][0] + C[0][1][1])/4, - (C[1][0][0] + C[1][0][1] + C[1][1][0] + C[1][1][1])/4, - (C[0][0][0] + C[0][0][1] + C[1][0][0] + C[1][0][1])/4, - (C[0][1][0] + C[0][1][1] + C[1][1][0] + C[1][1][1])/4, - (C[0][0][0] + C[0][1][0] + C[1][0][0] + C[1][1][0])/4, - (C[0][0][1] + C[0][1][1] + C[1][0][1] + C[1][1][1])/4, - } - texture_list { - 4 - texture { pigment { color rgb <0.5, 0.5, 0.5> } } - texture { pigment { color rgb <0.9, 0.5, 0.5> } } - texture { pigment { color rgb <0.5, 0.9, 0.5> } } - texture { pigment { color rgb <0.5, 0.5, 0.9> } } - } - face_indices { - 24 - <0, 1, 8>, 0, <1, 2, 8>, 1, <2, 3, 8>, 2, <3, 0, 8>, 3, - <4, 5, 9>, 0, <5, 6, 9>, 1, <6, 7, 9>, 2, <7, 4, 9>, 3, - <0, 1, 10>, 0 <1, 4, 10>, 1, <4, 5, 10>, 2, <5, 0, 10>, 3, - <2, 3, 11>, 0 <3, 6, 11>, 1, <6, 7, 11>, 2, <7, 2, 11>, 3, - <0, 2, 12>, 0 <2, 4, 12>, 1, <4, 6, 12>, 2, <6, 0, 12>, 3, - <1, 3, 13>, 0 <3, 5, 13>, 1, <5, 7, 13>, 2, <7, 1, 13>, 3, +#declare posbi0 = + box { + <-R1, -R1, -R1>, + texture { pigment { color rgb <1, 1, 1> } } } +#declare Foo = function(r, lo, hi) { r + lo + hi } + +#declare rand2 = function(R, Lo, Hi) { R * (Hi - Lo) - Lo } + +#declare posbi1 = union { + object { posbi0 } + + #local S = 200; + #local X = -2*R1; + #while (X <= 2*R1) + #local Y = -2*R1; + #while (Y <= 2*R1) + #local P = trace(posbi0, , -); + + #switch (rand(RND1) * 3) + #range(0, 1) + box { + <-1, -1, -1> + <+1, +1, +1> + scale S/2 + #if (1) + matrix < + rand2(rand(RND1), -0.5, 0.5), rand2(rand(RND1), -0.5, 0.5), rand2(rand(RND1), -0.5, 0.5), + rand2(rand(RND1), -0.5, 0.5), rand2(rand(RND1), -0.5, 0.5), rand2(rand(RND1), -0.5, 0.5), + rand2(rand(RND1), -0.5, 0.5), rand2(rand(RND1), -0.5, 0.5), rand2(rand(RND1), -0.5, 0.5), + 0, 0, 0 + > + #end + translate P + texture { pigment { color rgb <1, 0, 0> } } + } + + #break + #end + + #local Y = Y + 2*S; // YYY + #end + + #local X = X + 2*S; // XXX + #end + } + +#declare posbi = + object { + posbi1 + } + diff --git a/pr/posbi/test-mesh.pov b/pr/posbi/test-mesh.pov index 3ca6517..907e047 100644 --- a/pr/posbi/test-mesh.pov +++ b/pr/posbi/test-mesh.pov @@ -24,8 +24,8 @@ mesh2 { 5, <-1, -1, 0>, <-1, +1, 0>, - <+1, -1, 0>, <+1, +1, 0>, + <+1, -1, 0>, < 0, 0, 0>, } texture_list { diff --git a/pr/posbi/test-posbi.pov b/pr/posbi/test-posbi.pov index 14f4379..166df3f 100644 --- a/pr/posbi/test-posbi.pov +++ b/pr/posbi/test-posbi.pov @@ -16,7 +16,7 @@ light_source { color White } -#local CP = <+5000, +2500, -1000>; +#local CP = <+5000, +2500, 10000>; light_source { CP color White*0.5 @@ -30,6 +30,7 @@ light_source { //} camera { location CP + angle 40 look_at <-0, 900, -0> } @@ -37,6 +38,7 @@ camera { object { posbi + translate <0, 1000, 0> } #declare gatter = @@ -71,10 +73,11 @@ camera { } +#if (0) object { gatter rotate <90, 0, 0> scale 100 } - +#end