SBT-raytracer 1.0
// cyl_cyl_refract.ray
// purpose: Test the refraction term
// depth: 10
// Don't forget to increase the trace depth to >= 2!
camera
{
position = (5, 0, 0);
viewdir = (-1, 0, 0);
updir = (0, 0, 1);
}
directional_light
{
direction = (-1, -1, -0.2);
color = (1, 1, 1);
}
// Sphere acts as a lens
translate( 0, 0, -0.5,
scale(.2, 1.5, 1.5, cylinder {
material = {
emissive = (0, 0.12, 0);
transmissive = (0.7, 0.7, 0.7);
index = 1.5;
}
} ) )
// Add a couple of crossed cylinders behind the sphere to
// see the refractive effect.
// Note that the reason these are emissive is that otherwise
// you have problems if transparent shadows aren't implemented.
translate( -2, -1, -10,
scale( .2, .2, 20,
cylinder {
material = { emissive = (0.8, 0.4, 0); }
} ) )
translate( 0, 0.5, 0,
rotate( 1, 0, 0, .6,
translate( -2, -1, -10,
scale( .2, .2, 20,
cylinder {
material = { emissive = (0.8, 0.0, 0.4); }
} ) ) ) )
point_light {
position = (1, 1, -3.0);
colour = (1.0, 1.0, 1.0);
constant_attenuation_coeff= 0.25;
linear_attenuation_coeff = 0.003372407;
quadratic_attenuation_coeff = 0.000045492;
}
rotate(1,1,1,1,
scale(1,
translate(-0.0,-0.0,-0.0,
polymesh {
points = (
(1,0,0),
(-1,0,0),
(0,1,0),
(0,-1,0),
(0,0,1),
(0,0,-1),
(0.707107,0.707107,0),
(0.707107,-0.707107,0),
(0.707107,0,0.707107),
(0.707107,0,-0.707107),
(-0.707107,0.707107,0),
(-0.707107,-0.707107,0),
(-0.707107,0,0.707107),
(-0.707107,0,-0.707107),
(0,0.707107,0.707107),
(0,0.707107,-0.707107),
(0,-0.707107,0.707107),
(0,-0.707107,-0.707107),
(0.925567,0.378585,0),
(0.925567,-0.378585,0),
(0.925567,0,0.378585),
(0.925567,0,-0.378585),
(-0.925567,0.378585,0),
(-0.925567,-0.378585,0),
(-0.925567,0,0.378585),
(-0.925567,0,-0.378585),
(0.378585,0.925567,0),
(-0.378585,0.925567,0),
(0,0.925567,0.378585),
(0,0.925567,-0.378585),
(0.378585,-0.925567,0),
(-0.378585,-0.925567,0),
(0,-0.925567,0.378585),
(0,-0.925567,-0.378585),
(0.378585,0,0.925567),
(-0.378585,0,0.925567),
(0,0.378585,0.925567),
(0,-0.378585,0.925567),
(0.378585,0,-0.925567),
(-0.378585,0,-0.925567),
(0,0.378585,-0.925567),
(0,-0.378585,-0.925567),
(0.787447,0.435848,0.435848),
(0.787447,0.435848,-0.435848),
(0.435848,0.787447,0.435848),
(0.435848,0.787447,-0.435848),
(0.787447,-0.435848,0.435848),
(0.787447,-0.435848,-0.435848),
(0.435848,-0.787447,0.435848),
(0.435848,-0.787447,-0.435848),
(0.435848,0.435848,0.787447),
(0.435848,-0.435848,0.787447),
(0.435848,0.435848,-0.787447),
(0.435848,-0.435848,-0.787447),
(-0.787447,0.435848,0.435848),
(-0.787447,0.435848,-0.435848),
(-0.435848,0.787447,0.435848),
(-0.435848,0.787447,-0.435848),
(-0.787447,-0.435848,0.435848),
(-0.787447,-0.435848,-0.435848),
(-0.435848,-0.787447,0.435848),
(-0.435848,-0.787447,-0.435848),
(-0.435848,0.435848,0.787447),
(-0.435848,-0.435848,0.787447),
(-0.435848,0.435848,-0.787447),
(-0.435848,-0.435848,-0.787447));
normals = (
(1,1.196e-09,1.196e-09),
(-1,1.196e-09,-1.196e-09),
(1.196e-09,1,-2.67061e-09),
(1.196e-09,-1,1.196e-09),
(1.196e-09,1.196e-09,1),
(1.196e-09,-2.67061e-09,-1),
(0.707107,0.707107,-2.6181e-09),
(0.707107,-0.707107,-2.55399e-09),
(0.707107,-2.55399e-09,0.707107),
(0.707107,-2.6181e-09,-0.707107),
(-0.707107,0.707107,-2.6181e-09),
(-0.707107,-0.707107,-2.55399e-09),
(-0.707107,-2.55399e-09,0.707107),
(-0.707107,-2.6181e-09,-0.707107),
(-2.6181e-09,0.707107,0.707107),
(-2.55399e-09,0.707107,-0.707107),
(-2.6181e-09,-0.707107,0.707107),
(-2.55399e-09,-0.707107,-0.707107),
(0.938914,0.344151,2.2084e-09),
(0.938914,-0.344151,-2.95228e-09),
(0.938914,-2.95228e-09,0.344151),
(0.938914,2.2084e-09,-0.344151),
(-0.938914,0.344151,-2.2084e-09),
(-0.938914,-0.344151,2.95228e-09),
(-0.938914,2.2084e-09,0.344151),
(-0.938914,-2.95228e-09,-0.344151),
(0.344151,0.938914,-2.2084e-09),
(-0.344151,0.938914,2.2084e-09),
(2.2084e-09,0.938914,0.344151),
(-2.95228e-09,0.938914,-0.344151),
(0.344151,-0.938914,2.2084e-09),
(-0.344151,-0.938914,-2.95228e-09),
(-2.95228e-09,-0.938914,0.344151),
(2.2084e-09,-0.938914,-0.344151),
(0.344151,2.2084e-09,0.938914),
(-0.344151,-2.95228e-09,0.938914),
(-2.95228e-09,0.344151,0.938914),
(2.2084e-09,-0.344151,0.938914),
(0.344151,-2.2084e-09,-0.938914),
(-0.344151,2.2084e-09,-0.938914),
(2.2084e-09,0.344151,-0.938914),
(-2.95228e-09,-0.344151,-0.938914),
(0.781031,0.441583,0.441583),
(0.781031,0.441583,-0.441583),
(0.441583,0.781031,0.441583),
(0.441583,0.781031,-0.441583),
(0.781031,-0.441583,0.441583),
(0.781031,-0.441583,-0.441583),
(0.441583,-0.781031,0.441583),
(0.441583,-0.781031,-0.441583),
(0.441583,0.441583,0.781031),
(0.441583,-0.441583,0.781031),
(0.441583,0.441583,-0.781031),
(0.441583,-0.441583,-0.781031),
(-0.781031,0.441583,0.441583),
(-0.781031,0.441583,-0.441583),
(-0.441583,0.781031,0.441583),
(-0.441583,0.781031,-0.441583),
(-0.781031,-0.441583,0.441583),
(-0.781031,-0.441583,-0.441583),
(-0.441583,-0.781031,0.441583),
(-0.441583,-0.781031,-0.441583),
(-0.441583,0.441583,0.781031),
(-0.441583,-0.441583,0.781031),
(-0.441583,0.441583,-0.781031),
(-0.441583,-0.441583,-0.781031));
faces = (
(36,50,14),
(29,45,15),
(32,48,16),
(41,53,17),
(35,62,12),
(25,55,13),
(31,60,11),
(23,59,11),
(20,42,8),
(26,44,6),
(42,50,8),
(18,43,6),
(38,52,9),
(43,45,6),
(19,46,7),
(34,51,8),
(46,48,7),
(21,47,9),
(30,49,7),
(47,53,9),
(28,56,14),
(22,54,10),
(56,62,14),
(27,57,10),
(40,64,15),
(57,55,10),
(37,63,16),
(24,58,12),
(63,60,16),
(39,65,13),
(33,61,17),
(65,59,13),
(34,36,4),
(50,34,8),
(34,50,36),
(26,29,2),
(45,26,6),
(26,45,29),
(30,32,3),
(48,30,7),
(30,48,32),
(38,41,5),
(53,38,9),
(38,53,41),
(36,35,4),
(62,36,14),
(36,62,35),
(22,25,1),
(55,22,10),
(22,55,25),
(32,31,3),
(60,32,16),
(32,60,31),
(25,23,1),
(59,25,13),
(25,59,23),
(18,20,0),
(42,18,6),
(18,42,20),
(28,26,2),
(44,28,14),
(28,44,26),
(44,42,6),
(50,44,14),
(44,50,42),
(21,18,0),
(43,21,9),
(21,43,18),
(40,38,5),
(52,40,15),
(40,52,38),
(52,43,9),
(45,52,15),
(52,45,43),
(20,19,0),
(46,20,8),
(20,46,19),
(37,34,4),
(51,37,16),
(37,51,34),
(51,46,8),
(48,51,16),
(51,48,46),
(19,21,0),
(47,19,7),
(19,47,21),
(33,30,3),
(49,33,17),
(33,49,30),
(49,47,7),
(53,49,17),
(49,53,47),
(27,28,2),
(56,27,10),
(27,56,28),
(24,22,1),
(54,24,12),
(24,54,22),
(54,56,10),
(62,54,12),
(54,62,56),
(29,27,2),
(57,29,15),
(29,57,27),
(39,40,5),
(64,39,13),
(39,64,40),
(64,57,15),
(55,64,13),
(64,55,57),
(35,37,4),
(63,35,12),
(35,63,37),
(23,24,1),
(58,23,11),
(23,58,24),
(58,63,12),
(60,58,11),
(58,60,63),
(41,39,5),
(65,41,17),
(41,65,39),
(31,33,3),
(61,31,11),
(31,61,33),
(61,65,17),
(59,61,11),
(61,59,65));
material = {
ambient = (0.0,0.0,0.0);
diffuse = (0.3,0.6,0.3);
specular = (0.5,0.5,0.5);
transmissive = (0,0,0);
shininess = 10;
}
}
)))