// Fireworks // copyright October 2000 Rune S. Johansen #version unofficial MegaPOV 0.6; #macro Pyrotech1 (_Location,_Size,_Clock,_Type,_Glows,_Brightness,_Color1,_Color2,_Seed) #if (_Clock>0&_Clock<1) #declare _X = 0; #declare _S = seed(_Seed); #while (_X<_Glows) glow { #if (_Type=1) #declare _V = <1,1,1>; #while (vlength(_V)>1) #declare _V = (-0.5)*2; #end #end #if (_Type=2) #declare _V = vnormalize(-0.5); #end location _V*_Size*sqrt(_Clock)+_Location color vnormalize(< _Color1.x+(_Color2-_Color1).x*rand(_S), _Color1.y+(_Color2-_Color1).y*rand(_S), _Color1.z+(_Color2-_Color1).z*rand(_S), >) * _Brightness*2.5*(1-_Clock)*sqrt(_Clock) } #declare _X = _X+1; #end #end #end #declare Clock = clock; Pyrotech1 ( <+8,-1,30>-y*sqr(Clock*2), 18, // location, size Clock*2, // local clock 1, 200, 0.013, // type, number_of_glows, brightness <0.5,0.5,0.3>, <0.8,0.8,0.6>, 2 // color1, color2, seed ) Pyrotech1 ( <-8,-2,30>-y*sqr((Clock-0.3)*2), 16, // location, size (Clock-0.3)*2, // local clock 2, 100, 0.026, // type, number_of_glows, brightness <0.0,0.0,0.0>, <0.8,0.2,1.0>, 2 // color1, color2, seed ) Pyrotech1 ( <+5,+5,30>-y*sqr((Clock-0.5)*2), 17, // location, size (Clock-0.5)*2, // local clock 2, 200, 0.013, // type, number_of_glows, brightness <0.0,0.0,0.0>, <0.4,1.0,0.5>, 2 // color1, color2, seed ) // There have to be an object in the scene sphere {-z, 0.1 pigment {color 0}}