|
|
// PoVRay 3.7 Scene File "btfh2.pov"
// author: BGimeno
// date: 30/Nov/2017
//------------------------------------------------------------------------
#declare Camera_Focal_Blur = off ;
#declare radiocity = off ; // radiosity on -off
#declare area_lite = off ; // area_light on/off
#version 3.7;
#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"
//------------------------------------------------------------------------
#default{
finish{ ambient 0.1 diffuse 0.9 }
}
global_settings {
assumed_gamma 1.0
#if (radiocity=on)
radiosity {
pretrace_start 0.08 // start pretrace at this size
pretrace_end 0.01 // end pretrace at this size
count 300 // higher -> higher quality (1..1600) [35]
nearest_count 5 // higher -> higher quality (1..10) [5]
error_bound 1.2 // higher -> smoother, less accurate [1.8]
recursion_limit 3 // how much interreflections are calculated
(1..5+) [3]
low_error_factor .5 // reduce error_bound during last pretrace
step
gray_threshold 0.0 // increase for weakening colors (0..1) [0]
minimum_reuse 0.015 // reuse of old radiosity samples [0.015]
brightness 1 // brightness of radiosity effects (0..1) [1]
adc_bailout 0.01/2
//normal on // take surface normals into account [off]
//media on // take media into account [off]
always_sample on // turn sampling in final trace off [on]
//max_sample 1.0 // maximum brightness of samples
}
#end // if radiocity
}
//------------------------------------------------------------------------
#declare Camera_0 = camera {/*ultra_wide_angle*/ angle 15 // front view
location <0.0 , 1.0 ,-40.0>
right x*image_width/image_height
look_at <0.0 , 1.0 , 0.0>}
#declare Camera_1 = camera {/*ultra_wide_angle*/ angle 16 // diagonal view
location <20.0 , 6.0 ,-18.0>
right x*image_width/image_height
look_at <0.0 , 0 , 0.0>}
#declare Camera_2 = camera {/*ultra_wide_angle*/ angle 90 //right side view
location <3.0 , 1.0 , 0.0>
right x*image_width/image_height
look_at <0.0 , 1.0 , 0.0>}
#declare Camera_3 = camera {/*ultra_wide_angle*/ angle 90 // top view
location <0.0 , 3.0 ,-0.001>
right x*image_width/image_height
look_at <0.0 , 1.0 , 0.0>}
#if (Camera_Focal_Blur=off)
camera{Camera_1}
#else
// focal blur camera
camera {
angle 16
location <20.0, 6.0, -18.0>
look_at <0.0, 0.0, 0.0>
right x*image_width/image_height
aperture 0.75 // [0...N] larger is narrower depth of field
(blurrier)
blur_samples 400 // number of rays per pixel for sampling
focal_point <0,1,0> // point that is in focus <X,Y,Z>
confidence 0.95 // [0...<1] when to move on while sampling (smaller is
less accurate)
variance 1/5000 // [0...1] how precise to calculate (smaller is more
accurate)
}
#end
//------------------------------------------------------------------------
// light -------------------------------------------------------------------
#if (area_lite=off)
light_source {<0,10,0> color White
fade_distance 5
fade_power 2
}
#else
light_source {
<0,0,0> // light's position (translated below)
color rgb .75 // light's color
area_light
<-6, 0, -10> <-1, 0, 10> // lights spread out across this distance (x * z)
2, 8 // total number of lights in grid (4x*4z = 16 lights)
adaptive 2 // 0,1,2,3...
jitter // adds random softening of light
translate <0, 10, 0> // <x y z> position of light
looks_like {
union {
box { <-6, 0, -10>,<-1,0,10> }
box { <1, 0, -10>,<6,0,10> }
}
pigment { White } no_shadow
translate <0, 10, 0> // <x y z> position of light
}
}
#end // if area_lite
//------------------------------------------------------------------------
// room -----------------------------------------------------------------
//---------------------------------<<< settings of squared plane dimensions
#declare RasterScale = 1.0;
#declare RasterHalfLine = 0.035;
#declare RasterHalfLineZ = 0.035;
//-------------------------------------------------------------------------
#macro Raster(RScale, HLine)
pigment{ gradient x scale RScale
color_map{[0.000 color rgbt<1,1,1,0>*0.6]
[0+HLine color rgbt<1,1,1,0>*0.6]
[0+HLine color rgbt<1,1,1,1>]
[1-HLine color rgbt<1,1,1,1>]
[1-HLine color rgbt<1,1,1,0>*0.6]
[1.000 color rgbt<1,1,1,0>*0.6]} }
#end// of Raster(RScale, HLine)-macro
//-------------------------------------------------------------------------
plane { <0,1,0>, 0 // plane with layered textures, floor
texture { pigment{color White}
// finish {ambient 0.3 diffuse 0.85}
}
texture { Raster(RasterScale,RasterHalfLine ) rotate<0,0,0> }
texture { Raster(RasterScale,RasterHalfLineZ) rotate<0,90,0>}
rotate<0,0,0>
}
plane { <0,1,0>, 0 // plane with layered textures, ceiling
texture { pigment{color Black}
finish {ambient 0.45 diffuse 0.85}}
texture { Raster(RasterScale,RasterHalfLine ) rotate<0,0,0> }
texture { Raster(RasterScale,RasterHalfLineZ) rotate<0,90,0>}
translate <0,21,0>
}
plane { <0,1,0>, 0 // plane with layered textures, back wall
texture { pigment{color Gray40}
finish {ambient 0.45 diffuse 0.85}}
texture { Raster(RasterScale,RasterHalfLine ) rotate<0,0,0> }
texture { Raster(RasterScale,RasterHalfLineZ) rotate<0,90,0>}
rotate<90,0,0>
translate <0,0,20>
}
plane { <0,1,0>, 0 // plane with layered textures, back wall
texture { pigment{color Gray40}
finish {ambient 0.45 diffuse 0.85}}
texture { Raster(RasterScale,RasterHalfLine ) rotate<0,0,0> }
texture { Raster(RasterScale,RasterHalfLineZ) rotate<0,90,0>}
rotate<90,0,0>
translate <0,0,-20>
}
plane { <0,1,0>, 0 // plane with layered textures, right wall
texture { pigment{color Gray40}
finish {ambient 0.45 diffuse 0.85}}
texture { Raster(RasterScale,RasterHalfLine ) rotate<0,0,0> }
texture { Raster(RasterScale,RasterHalfLineZ) rotate<0,90,0>}
rotate<0,0,90>
translate <20,0,0>
}
plane { <0,1,0>, 0 // plane with layered textures, left wall
texture { pigment{color Gray40}
finish {ambient 0.45 diffuse 0.85}}
texture { Raster(RasterScale,RasterHalfLine ) rotate<0,0,0> }
texture { Raster(RasterScale,RasterHalfLineZ) rotate<0,90,0>}
rotate<0,0,90>
translate <-20,0,0>
}
//------------------------------------------------ end of squared plane XZ
//--------------------------------------------------------------------------
//---------------------------- objects in scene ----------------------------
//--------------------------------------------------------------------------
#macro Sphere_of_tori (segments,r,thckn,simmetry,inner_sphere_mode,shape)
#macro sph (segments,r,thckn)
#local tmp_sg = segments+1;
union {
#local segments_r = 1 ;
#while (segments_r<tmp_sg)
#switch (shape)
#case (1)
torus {r*sind((180/(tmp_sg))*(segments_r)),thckn
#break
#case (2)
cylinder
{<0,-thckn,0>,<0,thckn,0>,r*sind((180/(tmp_sg))*(segments_r))
#break
#case (3)
difference {
cylinder
{<0,-thckn,0>,<0,thckn,0>,r*sind((180/(tmp_sg))*(segments_r))}
cylinder
{<0,-thckn*2,0>,<0,thckn*2,0>,r*sind((180/(tmp_sg))*(segments_r))-(thckn*2)}
#break
#else
torus {r*sind((180/(tmp_sg))*(segments_r)),thckn
#end
translate y*r*cosd((180/(tmp_sg))*(segments_r))
}
#local segments_r = segments_r + 1 ;
#end
}
#end
#if (inner_sphere_mode=2)
difference { sphere {<0,0,0>,r pigment {Black} finish {reflection .1}}
#end
union {
#switch (simmetry)
#case (0)
object { sph (segments,r,thckn) }
#break
#case (1) // Hexahedron
object { sph (segments,r,thckn) }
object { sph (segments,r,thckn) rotate z*90 }
object { sph (segments,r,thckn) rotate x*90 }
#break
#case (2) // octahedron
object { sph (segments,r,thckn) }
object { sph (segments,r,thckn) rotate x*90 rotate <19.471220634, 0,
0> }
object { sph (segments,r,thckn) rotate x*90 rotate <19.471220634, 120,
0> }
object { sph (segments,r,thckn) rotate x*90 rotate <19.471220634, 240,
0> }
#break
#case (3) // Dodecahedron
object { sph (segments,r,thckn) }
object { sph (segments,r,thckn) rotate <63.434948823, 0, 0> }
object { sph (segments,r,thckn) rotate <63.434948823, 72, 0> }
object { sph (segments,r,thckn) rotate <63.434948823,144, 0> }
object { sph (segments,r,thckn) rotate <63.434948823,216, 0> }
object { sph (segments,r,thckn) rotate <63.434948823,288, 0> }
#break
#case (4) // Icosahedron
object { sph (segments,r,thckn) rotate <37.3375, 0, 0> }
object { sph (segments,r,thckn) rotate <37.3375, 72, 0> }
object { sph (segments,r,thckn) rotate <37.3375,144, 0> }
object { sph (segments,r,thckn) rotate <37.3375,216, 0> }
object { sph (segments,r,thckn) rotate <37.3375,288, 0> }
object { sph (segments,r,thckn) rotate <79.1875, 0, 0> }
object { sph (segments,r,thckn) rotate <79.1875, 72, 0> }
object { sph (segments,r,thckn) rotate <79.1875,144, 0> }
object { sph (segments,r,thckn) rotate <79.1875,216, 0> }
object { sph (segments,r,thckn) rotate <79.1875,288, 0> }
#break
#case (5) // Rhombicuboctahedron
object { sph (segments,r,thckn) }
object { sph (segments,r,thckn) rotate z*90 }
object { sph (segments,r,thckn) rotate x*90 }
object { sph (segments,r,thckn) rotate x*90 rotate y*-45 }
object { sph (segments,r,thckn) rotate x*90 rotate y* 45 }
object { sph (segments,r,thckn) rotate x*45}
object { sph (segments,r,thckn) rotate x*-45}
object { sph (segments,r,thckn) rotate x*45 rotate y*90}
object { sph (segments,r,thckn) rotate x*-45 rotate y*90}
#break
#case (6) // test
object { sph (segments,r,thckn) rotate z*90}
object { sph (segments,r,thckn) rotate < 30,0,90>}
object { sph (segments,r,thckn) rotate < 60,0,90>}
object { sph (segments,r,thckn) rotate < 90,0,90>}
object { sph (segments,r,thckn) rotate <120,0,90>}
object { sph (segments,r,thckn) rotate <150,0,90>}
object { sph (segments+1,r,thckn) }
#break
#end
#if (inner_sphere_mode=1) sphere {<0,0,0>,r-(thckn*1.25) pigment {Black}
finish {reflection .1}} #end
#if (inner_sphere_mode=2) } #end
}
#end
//--------------------------------------------------------------------------
#macro CW_angle (COLOR,A)
#local RGB = color COLOR;
#local R = (RGB.red);
#local G = (RGB.green);
#local B = (RGB.blue);
#local Min = min(R,min(G,B));
#local Max = max(R,max(G,B));
#local Span = Max-Min;
#local H = CRGB2H (<R,G,B>, Max, Span);
#local S = 0; #if (Max!=0) #local S = Span/Max; #end
#local P = <H+A,S,Max> ;
#local HSV = color P ;
#local H = (HSV.red);
#local S = (HSV.green);
#local V = (HSV.blue);
#local SatRGB = CH2RGB(H);
#local RGB = ( ((1-S)*<1,1,1> + S*SatRGB) * V );
rgb <RGB.red,RGB.green,RGB.blue>
#end
//--------------------------------------------------------------------------
#macro btfh2 (Mj_Radius,Mn_Radius,NMj_Segments)
union {
#for (St,0,NMj_Segments,1)
#local Rnd = seed (St+2) ;
object {
Sphere_of_tori ( 1+int(5*rand(Rnd)), // number of segments
Mn_Radius, // outer radius
Mn_Radius*.05, // inner radius
int(7*rand(Rnd)), /* simmetry
0 - a single instance
1 - hexahedron
2 - octahedron
3 - dodecahedron
4 - icosahedron
5 - rhombicuboctahedron
6 - experimental A
*/
1+int(2*rand(Rnd)), /* Inner sphere mode
0 - no sphere, hollow
1 - sphere with a radius =
outer_radius-inner_radius
2 - differenced sphere - tori
*/
1 /* shape
1 - torus
2 - cylinders
3 - open cylinders
*/
)
rotate <rand(Rnd)*1440,rand(Rnd)*-720,rand(Rnd)*28800>
translate z*Mj_Radius
rotate y*(360/NMj_Segments)*St
translate y*Mn_Radius
material {
texture {
pigment { CW_angle (Red,(360/NMj_Segments)*St)
}
finish {
diffuse albedo 0.65
reflection { 0.15,0.05
exponent 2
falloff 3
}
conserve_energy
irid { 0.2
thickness 0.1
turbulence 0.2
}
}
}
interior {ior 1.33}
} // end of material
} // end of sphere
#end
}
#end
//--------------------------------------------------------------------------
object {
btfh2 (
3, // major radius
.35, // minor radius
20 // number of spheres
)
}
Post a reply to this message
|
|