|
|
"Mike Williams" <nos### [at] econymdemoncouk> wrote:
> I managed to create a procedural version that has the black grout lines
> between the tiles. The "scale 1.0472" was determined by trial and error,
> looking at a region 5000 units away from the origin to magnify the
> discrepancies. I guess that 1.0472 should really be some expression
> containing things like pi and sin(pi/3), but I can't work it out.
Here's my version.
// Persistence of Vision Ray Tracer Scene Description File
//
// Tile pigment & normal from a function. Based on code from:
//
// From: Mike Williams
// Subject: Re: First Post.
// Date: 13 Jul 2005 18:23:50
// Message: <F1Q### [at] econymdemoncouk>
//
// -f -a0.4 +AM2 +R2
// -D +A0.1 +AM2 +R3
// -D +A0.15 +AM2 +R4
//
#version 3.6;
global_settings {
assumed_gamma 1.0
max_trace_level 10
}
#include "colors.inc"
#include "stones1.inc"
// ---Textures-----------------------------
#declare Ang = pi*2/3;
#declare S=sin(Ang);
#declare C=cos(Ang);
#declare f_Tile = function {sin(x-pi/2) * sin(x*C+z*S) * sin(x*C-z*S) / 4}
#declare GW = 0.0025;
#declare NTile = normal{function{-0.75*GW/abs(f_Tile(x,y,z))}}
//------------- White Marble with gray veining. Note: some of these textures
contain crand!!!
#declare T_Stone17 =
texture{T_Grnt20 scale <1, 2, 2> rotate <0, 0, -30>
finish{ambient 0.2 diffuse 0.9} normal{NTile 2 scale 1/2 }
}
texture{T_Grnt8a scale <2.5, 4.5, 3.5> rotate <0, 0, 40>
finish{phong 1.0 phong_size 90}
}
texture{T_Crack3 scale <1, 2, 1.4> rotate <10, 0, -20>
finish{phong 1.0 phong_size 90 reflection 0.1}
}
//------------- Brown & Olive Marble. Now without white veining
#declare T_Stone20 =
texture{T_Grnt27 scale <0.7, 0.99, 0.7> rotate <0, 0, 40> normal{NTile 5
scale 1/5 }}
texture{T_Grnt12a scale <1, 1.3, 2> rotate <0, 0, 40>}
texture{T_Crack1 scale <1, 0.6, 1> rotate <10, 0, -20>
finish{phong 1.0 phong_size 90 reflection 0.1}
}
#declare TGrout =
texture{
pigment{rgb 1.125}
finish{ambient 0.05 diffuse 0.95}
normal{granite .2 scale .080 bump_size .275}
}
#declare T0 = texture {TGrout scale 1 } // texture for grout
#declare T1 = texture {T_Stone20 scale 5 } // Texture for hexagons
#declare T2 = texture {T_Stone17 scale 2 } // texture for triangles
#declare TFloor =
texture {
function{f_Tile(x,y,z)}
texture_map { [.5-GW T2][.5-GW T0][.5+GW T0][.5+GW T1] } phase .5
}
#declare TMetal =
texture {
pigment {rgb <0.95,0.95,1.0>*.9}
finish{
diffuse 0.15 ambient 0.0
specular 0.50 roughness 1e-5
reflection {0.55,0.65 metallic}
conserve_energy
}
}
// ---Objects------------------------------
#declare Floor =
plane {y,0
texture {
//TGrout
TFloor
scale .5
}
}
// reflective post
#declare BRad = 0.25;
#declare PY = 5;
#declare Post = cylinder{0, y*PY*BRad, BRad texture {TMetal}}
// ---Scene--------------------------------
camera {
location <0.0, 4, -8> * 1
look_at -y*.5
angle 36
right x*image_width/image_height up y
direction z
}
light_source {<-30, 30, -30> rgb 1}
#if(0)
sky_sphere {
pigment {
gradient y
color_map {
[0.0 rgb <0.6,0.7,1.0>]
[0.7 rgb <0.0,0.1,0.8>]
}
}
}
#end
object{Floor}
//object{Post}
// ----------------------------------------
Post a reply to this message
Attachments:
Download 'functileb1.jpg' (131 KB)
Preview of image 'functileb1.jpg'
|
|