/*** board-scene1.pov
Demo Povray scene, created April 2009 by Michael Uchima
There are two changes you will want to make in order to get this
scene to render on your system:
1) In the definition of the LCD object, edit the image_map line
to specify the name of a file containing the screenshot you
wish to have appear on the monitor.
2) On non-Windows systems, you will need to get a copy of the
arialbi.ttf (Arial Bold Italic) TrueType font file, and put
it in the same folder as this file in order to render the
logo on the edge of the LCD monitor's bezel. (Alternatively,
you can just remove the code that renders the logo...)
*/
#include "colors.inc"
#include "shapes.inc"
#include "shapes2.inc"
#include "textures.inc"
#include "woods.inc"
#include "metals.inc"
#include "stones.inc"
// Set the view number here; alternatively, comment out
// the following line and pass ViewNumber in on the command line.
#declare ViewNumber = 1;
global_settings { number_of_waves 3 max_trace_level 10 }
/*** Define the various camera locations ***/
#switch (ViewNumber)
#case (1)
/* View 1 - entire scene */
camera {
location <30, 20, -25 >
look_at <0, 4, 0>
angle 30
}
#break
#case (2)
/* View 2 - Thru the red pawn */
camera {
location <2.5, 2, -5 >
look_at <-2, 1, 2>
angle 30
}
#break
#case (3)
/* View 3 - From the other side and lower down */
camera {
location <-15, 7, -30 >
look_at <0, 2, 3>
angle 30
}
#break
#case (4)
/* View 4 - Looking up at the brass rook */
camera {
location <-6, 1.2, 1.75 >
look_at <-1.5, 1.75, 1.5>
angle 30
}
#break
#end
/*** Define light sources ***/
light_source {
<-6, 10, -6>
color White
area_light <2, 0, 0>, <0, 0, 2>, 3, 3
adaptive 1
jitter
}
light_source {
<-10, 10, -6>
color White
area_light <2, 0, 0>, <0, 0, 2>, 3, 3
adaptive 1
jitter
}
/*** Build a chessboard ***/
#declare Tex1 = T_Stone13;
#declare Tex2 = T_Stone21;
#declare Tex3 = T_Wood19;
#declare Cube1 = object { box { <-0.5, -0.5, -0.5> <0.5, 0.5, 0.5> } }
#declare Squares = union {
#declare row = 0;
#while (row < 8)
#declare col = 0;
#while (col < 8)
#if (mod(row + col, 2) = 0)
#declare tex = Tex1;
#else
#declare tex = Tex2;
#end
object {
Cube1 texture { tex translate
} finish { specular 0.3 roughness .01 } translate
}
#declare col = col + 1;
#end
#declare row = row + 1;
#end
}
#declare EdgeCut = intersection {
object { box { <-5.01, -0.25, -0.25> <5.01, 0.25, 0.25> } }
object { cylinder { <-5.02, -0.25, 0.25> <5.02, -0.25, 0.25> .25 } inverse }
}
#declare EdgeBlock = intersection {
object { box { <-5, -0.5, -0.5> <5, 0.5, 0.5> } }
object { EdgeCut translate <0, .5, -.5> inverse }
object { plane { x, 0 rotate <0, 45, 0> translate <-4.5, 0, 0> } inverse }
object { plane { x, 0 rotate <0, 135, 0> translate <4.5, 0, 0> } inverse }
}
#declare Frame = intersection {
union {
object { EdgeBlock texture { Tex3 scale <1, 1, 1> translate <.3, 0, 0> rotate <0, 90, 0> } translate <0, 0, -4.5> }
object { EdgeBlock texture { Tex3 scale <1, 1, 1> translate <.2, .25, 0> rotate <0, 90, 0> } rotate <0, 180, 0> translate <0, 0, 4.5> }
object { EdgeBlock texture { Tex3 scale <1, 1, 1> translate <.1, 1, 0> rotate <0, 90, 0> } rotate <0, 90, 0> translate <-4.5, 0, 0> }
object { EdgeBlock texture { Tex3 scale <1, 1, 1> translate <0, 1.25, 0> rotate <0, 90, 0> } rotate <0, -90, 0> translate <4.5, 0, 0> }
}
}
#declare Board = union {
object { Squares }
object { Frame }
}
/*** Build some chess pieces ***/
#declare Base = union {
object { torus { 0.4, 0.1 translate <0, 0.1, 0> } }
object { cylinder { <0, 0, 0>, <0, .1, 0>, 0.5 } }
object { cylinder { <0, .099, 0>, <0, .2, 0>, 0.4 } }
intersection {
object { cylinder { <0, .199, 0>, <0, .4, 0>, 0.4 } }
object { torus { 0.4, 0.2 translate <0, .4, 0> } inverse }
}
}
#declare Pawn = union {
object { Base }
object { cylinder { <0, .399, 0>, <0, 1.201, 0>, 0.2 } }
object { cylinder { <0, 1.2, 0>, <0, 1.3, 0>, 0.3 } }
object { torus { 0.3, 0.05 translate <0, 1.25, 0> } }
object { sphere { <0, 1.5, 0> 0.25 } }
scale 0.6
}
#declare Rook = union {
object { Base }
object { cylinder { <0, .399, 0>, <0, 1.201, 0>, 0.2 } }
intersection {
object { cylinder { <0, 1.2, 0>, <0, 1.5, 0>, 0.35 } }
object { cylinder { <0, 1.3, 0>, <0, 1.501, 0>, 0.25 } inverse }
object { box { <-.351, 1.4, -.05> <.351, 1.501, .05> } inverse }
object { box { <-.05, 1.4, -.351> <.05, 1.501, .351> } inverse }
}
scale 0.8
}
/*** Define some colored glass textures ***/
#declare T_ClearGlass = texture {
pigment { color red 1.0 green 1.0 blue 1.0 filter 0.99 }
finish {
ambient 0.0
diffuse 0.0
reflection 0.1
phong 0.3
phong_size 90
}
}
#declare T_BlueGlass = texture {
pigment { color red 0.9 green 0.9 blue 1.0 filter 0.99 }
finish {
ambient 0.0
diffuse 0.0
reflection 0.1
phong 0.3
phong_size 90
}
}
#declare T_GreenGlass = texture {
pigment { color red 0.9 green 1.0 blue 0.9 filter 0.99 }
finish {
ambient 0.0
diffuse 0.0
reflection 0.1
phong 0.3
phong_size 90
}
}
#declare T_RedGlass = texture {
pigment { color red 1.0 green 0.9 blue 0.9 filter 0.99 }
finish {
ambient 0.0
diffuse 0.0
reflection 0.1
phong 0.3
phong_size 90
}
}
#declare I_Glass =
interior{
ior 1.25
caustics 2
fade_distance 40
fade_power 1
}
/*** Place the chess pieces on the board ***/
#declare BoardAndPieces = union {
object { Board }
object { Rook texture { T_Wood14 } rotate <0, 10, 0> translate <-3.5, .501, 3.5> }
object { Rook texture { T_Wood7 } rotate <0, 30, 0> translate <-.5, .501, -.5> }
object { Pawn texture { T_Wood30 } translate <2.5, .501, .5> }
object { Rook texture { T_Brass_5E } rotate <0, 45, 0> translate <-1.5, .501, 1.5> }
object { Pawn texture { T_Chrome_5E } translate <.5, .501, 0.5> }
object { Rook texture { T_Stone8 } rotate <0, 65, 0> translate <1.5, .501, 3.5> }
object { Pawn texture { T_Stone10 } translate <-2.5, .501, -3.5> }
object { Rook texture { T_Stone11 } rotate <0, 5, 0> translate <3.5, .501, 2.5> }
object { Rook texture { T_BlueGlass} rotate <0, 75, 0> interior { I_Glass } translate <0.5, .501, -2.5> }
object { Pawn texture { T_GreenGlass} interior { I_Glass } translate <3.5, .501, -3.5> }
object { Pawn texture { T_RedGlass} interior { I_Glass } translate <1.5, .501, -3.5> }
object { Rook texture { T_ClearGlass} rotate <0, 50, 0> interior { I_Glass } translate <2.5, .501, -1.5> }
}
/*** Build the LCD monitor ***/
#declare unitsquare = polygon {
5, <0,0>,<1,0>,<1,1>,<0,1>, <0,0>
translate <-0.5,-0.5,0>
}
#declare LCD = object {
unitsquare
texture {
pigment {
// The image_map line specifies what to display on the monitor; give
// it the name of a file containing the screenshot you want to use.
image_map {png "trshot3.png" interpolate 2 }
translate <-0.5,-0.5,0>
}
finish { ambient .8 }
}
scale <1, 0.8, 1>
}
#declare MonitorFrame = union {
intersection {
object { box { <-.6, -0.5, -0.03> <.6, .5, .05> } }
object { box { <-.5, -0.4, -0.031> <.5, .4, .01> } inverse }
}
texture {
pigment { color red 0.1 green 0.1 blue 0.15 }
finish { diffuse .5 specular 0.2 }
}
}
#declare Button = object {
box { <-0.01, -0.01, -0.0075> <0.01, 0.01, 0> }
texture { T_Chrome_4E }
}
#declare LED = object {
sphere { <0, 0, 0> 0.0075 }
texture {
pigment { Yellow }
finish { specular 0.75 ambient 1 }
}
}
#declare MonitorButtons = union {
object { Button translate <-0.2, 0, 0> }
object { Button translate <-0.1, 0, 0> }
object { Button translate <-0.0, 0, 0> }
object { Button translate <0.1, 0, 0> }
object { LED translate <0.2, 0, 0 > }
}
#declare MonitorStand = union {
object { cylinder { <0, 0, 0> <0, .03, 0> 0.35 } }
object { box { <-.075, 0, .001> <.075, .5, .04> } }
texture {
pigment { color red 0.15 green 0.15 blue 0.15 }
finish { diffuse .5 specular 0.2 }
}
}
#declare MonitorLogo = text {
// On non-Windows systems you will need to put a copy of the arialbi.ttf
// font file in the current directory for this to work.
ttf "arialbi.ttf" "JBI Ray-1" .2, 0
texture { T_Chrome_2E }
scale <.045, .045, .045>
}
#declare Monitor = union {
object { LCD }
object { MonitorFrame }
object { MonitorButtons translate <0, -0.45, -0.03> }
object { MonitorStand translate <0, -.7, 0> }
object { MonitorLogo translate <.35, .44, -0.0325> }
}
/*** Now place our objects in the scene ***/
// Create the ground plane.
plane { y, 0 texture { T_Stone1 } }
// Place the chess board.
object { BoardAndPieces translate <0, 0.5, 0> rotate <0, 0, 0> }
// Place the monitor.
object { Monitor translate <0, 0.7, 0> scale 8 translate <0, 0, 10.25> rotate <0, -35, 0> }