POV-Ray : Newsgroups : povray.binaries.images : Distant Haze - How To? : Re: Distant Haze - How To? Server Time
28 Apr 2024 15:07:11 EDT (-0400)
  Re: Distant Haze - How To?  
From: Bald Eagle
Date: 27 Apr 2018 15:00:00
Message: <web.5ae37205df423779c437ac910@news.povray.org>
Sven Littkowski <I### [at] SvenLittkowskiname> wrote:

> Is such a torus-shaped media possible?

Sure.
A torus is defined by the implicit equation
(sqrt(pow(x,2)-pow(y,2))-pow(R,2)+pow(z,2) = pow(r,2)

So if you do
sqrt((sqrt(pow(x,2)-pow(y,2))-pow(R,2)+pow(z,2)) you get r

divide by r and you get a range of 1 at the center and 0 at the surface (what
you'd see if you made an isosurface with threshold 0

So your media function would be:
#declare Torus = function {sqrt((sqrt(pow(x,2)-pow(y,2))-pow(R,2)+pow(z,2))/r}


Post a reply to this message

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