#include "colors.inc" #include "textures.inc" #include "metals.inc" #include "Entrust\EntrustLogo.inc" global_settings { assumed_gamma 2.2 } global_settings { ambient_light rgb< 3, 3, 3 > } // settings #declare drum_radius = 20; #declare drum_height = 100; #declare num_bubbles = 200; #declare R = seed(0); #declare bubbles = array[num_bubbles][5] #declare i = 0; #while ( i < num_bubbles ) #declare bubbles[i][0] = ( rand(R) * drum_radius * 2 ) - drum_radius; #declare bubbles[i][1] = ( rand(R) * drum_height ) - ( drum_height / 2 ); #declare bubbles[i][2] = sqrt( ( drum_radius * drum_radius ) - ( bubbles[i][0] * bubbles[i][0] ) ) * rand(R); #declare bubbles[i][3] = rand(R); #declare bubbles[i][4] = ( rand(R) * drum_height ) + ( drum_height / 2 ); #declare i = i + 1; #end #declare water = object { cylinder { < 0, drum_height / 2 + 1, 0 > < 0, -drum_height / 2 - 1, 0 > drum_radius + 1 } } #macro drum() union { #local i = 0; #while ( i < num_bubbles ) #local height = bubbles[i][1] + ( bubbles[i][4] * clock ); #if ( ( height > ( -drum_height / 2 ) ) & ( height < ( drum_height / 2 ) ) ) //#debug "first level" sphere { < bubbles[i][0], height, bubbles[i][2] > bubbles[i][3] } sphere { < -bubbles[i][0], height, -bubbles[i][2] > bubbles[i][3] } #end #local height = bubbles[i][1] - bubbles[i][4] + ( bubbles[i][4] * clock ); #if ( ( height > ( -drum_height / 2 ) ) & ( height < ( drum_height / 2 ) ) ) //#debug "second level" sphere { < bubbles[i][0], height, bubbles[i][2] > bubbles[i][3] } sphere { < -bubbles[i][0], height, -bubbles[i][2] > bubbles[i][3] } #end #local height = bubbles[i][1] - bubbles[i][4] - bubbles[i][4] + ( bubbles[i][4] * clock ); #if ( ( height > ( -drum_height / 2 ) ) & ( height < ( drum_height / 2 ) ) ) //#debug "third level" sphere { < bubbles[i][0], height, bubbles[i][2] > bubbles[i][3] } sphere { < -bubbles[i][0], height, -bubbles[i][2] > bubbles[i][3] } #end #local i = i + 1; #end } #end camera { location < 0, 1000, -2000 > look_at < 0, 0, 0 > angle 5 } light_source { < -200, 200, -200 > color White shadowless } object { drum() rotate y * 30 texture { T_Chrome_5C } } object { water texture { pigment { rgbf < 0, 1, 1, 0.6 > } } }