#include "colors.inc" #include "textures.inc" #include "metals.inc" global_settings { assumed_gamma 2.2 } global_settings { ambient_light rgb< 2, 2, 2 > } // settings #declare space_radius = 100; #declare space_length = 800; #declare object_count = 1000; #declare R = seed(0); // data structure // 0 - x coordinate // 1 - y coordinate // 2 - z coordinate // 3 - star diameter // 4 - distance to duplicate #declare data = array[object_count][5] #declare i = 0; #while ( i < object_count ) #declare data[i][0] = ( rand(R) * space_radius * 2 ) - space_radius; #declare data[i][1] = ( rand(R) * space_radius * 2 ) - space_radius; #declare data[i][2] = rand(R) * space_length * 1.1; #declare data[i][3] = max( rand(R), 0.1 ); #declare data[i][4] = space_length * data[i][3]; #declare i = i + 1; #end #macro thing( i, n ) #local pos = data[i][2] - ( data[i][4] * n ) + ( data[i][4] * clock ); #if ( ( pos >= 0 ) & ( pos <= space_length ) ) object { sphere { < data[i][0], data[i][1], -pos >data[i][3] } texture { pigment { color rgb < 1.5 - pos/space_length, 0.9, pos/space_length > } finish { F_MetalC } } } #end #end camera { location < 0, 0, -space_length > look_at < 0, 0, 0 > } light_source { < -space_radius, space_radius, -space_length > color White shadowless } object { union { #local i = 0; #while ( i < object_count ) #local j = -12; #while ( j <= 12 ) thing( i, j ) #local j = j + 1; #end #local i = i + 1; #end } }