POV-Ray : Newsgroups : povray.newusers : Media in a torus : Re: Media in a torus Server Time
6 Sep 2024 06:24:49 EDT (-0400)
  Re: Media in a torus  
From: Ilmari Karonen
Date: 7 Feb 1999 16:37:53
Message: <36be07b1.0@news.povray.org>
Margus Ramst wrote in message <366E25B3.6B018CAD@peak.edu.ee>...
>You can probably get the effect that you want by creating a circular array
of>spheres and filling each sphere with a spherical density media. With
enough>spheres, the result should look like a donut-shaped media.>Using
multiple media containers is rather slow, of course, but you can
get>virtually any shape of media you want.

Well, I just saw this old post and had to mention that the function
patterns in the Superpatch are great for this:

#macro Toroidal ( Major ) // minor radius always 1
  function { max(0,1-sqrt(x*x+y*y+z*z-Major*(2*sqrt(x*x+z*z)-Major))) }
#end


torus { 5, 1
  hollow
  pigment { rgbt 1 }
  interior {
    media {
      emission <0.5,1.0,1.5>
      density { Toroidal(5) cubic_wave }
    }
  }
}

--
Ilmari Karonen (ilt### [at] scifi)
http://www.sci.fi/~iltzu/


Post a reply to this message

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