POV-Ray : Newsgroups : povray.general : comet effect by translate? : Re: comet effect by translate? Server Time
7 May 2024 02:55:02 EDT (-0400)
  Re: comet effect by translate?  
From: Thomas de Groot
Date: 28 May 2018 02:48:58
Message: <5b0ba65a$1@news.povray.org>
On 26-5-2018 16:07, Kima wrote:
> There are some examples in this newsgroup for building a comet composed of a
> head and tail.
> 

In 2012 I built a scene of the Early Earth with meteor/comet showers. I 
looked up the code and found I used the following for building them:

//------------------------------------------------------------
#declare C_STAR = rgb <1.000, 0.477, 0.154>*1; //3000K
#declare fn_Disc = function (x) { 1 / (1 + pow (x, 3)) }
#declare fn_Spike = function (x) { 1 / (1 + pow (x, 2)) }

#declare Disc =
cylinder {0, y, 50
   hollow
   pigment {rgbt 1}
   interior {
     media {
       emission C_STAR * 10
       density {
         function {fn_Disc (sqrt (x*x + z*z))}
       }
     }
   }
}

#declare Diffraction_spike =
box {
   <-100, 0, -0.5>*4, <100, 1, 0.5>*4
   hollow
   pigment {rgbt 1}
   interior {
     media {
       emission C_STAR * 2
       density {
         function {fn_Spike (abs(x))}
       }
     }
   }
}

#declare Meteor_trail =
box {
   <0, -2, -2>*4, <10000, 2, 2>*4
   hollow
   pigment {rgbt 1}
   interior {
     media {
       emission C_STAR * 2
       density {
         function {fn_Spike (abs(x))}
       }
     }
   }
}

//---------------------------Meteor1
#declare star_pos = vaxis_rotate(SunPosition,x,10);
#declare star_pos = vaxis_rotate(star_pos,y,-170);
#declare YAxis = CamLoc - star_pos;

object {Disc
   scale 1800
   Point_At_Trans(YAxis)
   translate star_pos
}

object {Meteor_trail
   scale 1800
   rotate -100*y
   Point_At_Trans(YAxis)
   translate star_pos
}

object {Diffraction_spike
   scale 1200
   rotate 45*y
   Point_At_Trans(YAxis)
   translate star_pos
}

object {Diffraction_spike
   scale 1200
   rotate -45*y
   Point_At_Trans(YAxis)
   translate star_pos
}

//------------------------------------------------------------

A visualisation of this work canbe found here:
http://news.povray.org/povray.binaries.images/thread/%3C4ff1b4cc%40news.povray.org%3E/?ttop=422387&toff=1050

-- 
Thomas


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.