//cheapsmoke //inspired by the smoke effects in mario sunshine! ;) //to get a looping animation, render this over a series of frames that's a multiple of 100, but without the last frame: //e.g. Initial_Frame=0 Final_Frame=199 #include "transforms.inc" global_settings { max_trace_level 8 } camera { right x*image_width/image_height up y direction z*.5 #declare vCamPos = vrotate( <0,1,-3>*2, z*(frame_number*360/(final_frame+1) + 90) ) + <-1.5,3,0>; #declare vCamLook = <0,0,0>; #declare vCamDir = vnormalize(vCamLook - vCamPos); location vCamPos look_at vCamLook } light_source { <-1,1,1>*10000 rgb 1 } #declare oSmokeParticle = disc { 0, -z, 1 //hollow on finish { diffuse .6 ambient .4//.4//rgb <.1,.2,.3> } normal { spherical 4 slope_map { [0 <0,2>] [1 <1,0>] } } } #macro m_SmokeParticle(vPos,fRad,colColour) object { oSmokeParticle pigment { spherical colour_map { [0 colColour transmit 1] [.2 colColour] } } //set the size scale fRad //point it at the camera (neither of these perfectly emulate a sphere, so pick whichever looks best) Reorient_Trans( -z, -vCamDir ) //set the pos translate vPos } #end union { #declare rsSeed = seed(1100); #declare nParticlesNum = 300; #declare nParticle = 0; #while ( nParticle < nParticlesNum ) #declare fProp = (mod((nParticle + frame_number*3),nParticlesNum)/200); m_SmokeParticle( *2 - 1, (rand(rsSeed)*.4+.8)*(pow(fProp,2)*1.5+.5), rgb 1 transmit fProp/1.5 ) #declare nParticle = nParticle + 1; #end }