#!/usr/bin/perl use warnings; use strict; print <<EOF; #include "colors.inc" #include "stones1.inc" camera { location <1, 1, -2> look_at <2, 1, 0> } light_source { <100, 100, -100> color White } light_source { <-100, 100, -100> color Gray80 } plane { y, 0 /* pigment { color rgb<0, 0, 1> } finish { reflection .3 } normal { ripples .4 scale .07 } */ pigment { checker color Black color White } // checkered pattern } EOF my @colors = qw< Yellow Red Blue Green Pink Brown >; while(my ($x,$y,$z) = <> =~ /^(\S+)\s+(\S+)\s+(\S+)$/) { $z /= 500; $_ *= 2 for $x,$y; my $c = shift @colors; push @colors, $c; next if $z == 0; print <<""; cylinder { <$x,0,$y>, <$x,$z,$y>, 0.3 pigment { color $c } } }
Download