POV-Ray : Newsgroups : povray.binaries.images : Distant Haze - How To? : Re: Distant Haze - How To? Server Time
28 Apr 2024 16:55:55 EDT (-0400)
  Re: Distant Haze - How To?  
From: Bald Eagle
Date: 28 Apr 2018 07:55:00
Message: <web.5ae46037df4237795cafe28e0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

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

Transcription error in there - trying to juggle too many things at once and
convert to POV-Ray syntax from Wikipedia image.  :(

This is tested code, and you can see that it gets you identical results compared
to the internal f_torus function.   I haven't yet explored it further, but
perhaps the /r part I added just affects the density gradient towards the
center.  Maybe using it as a pigment function and cross section would answer
that.




#version 3.7;
global_settings {assumed_gamma 1.0}

#include "colors.inc"
#include "functions.inc"

sky_sphere {pigment {rgb <1, 1, 1>*1}}

camera {
   location <0, 0, -5>    // position & direction of view
  look_at  <0, 0, 0>
  right x*image_width/image_height           // horizontal size of view
  up y // vertical size of view
 }

light_source {<25, 25, -150> color White}

#declare R = 1;
#declare r = 0.5;

//#declare Torus = function (x, y, z) {sqrt(pow( sqrt(pow(x,2)+pow(y,2)) - R,2)
+ pow(z,2)) - r}
#declare Torus = function (x, y, z) {(sqrt(pow( sqrt(pow(x,2)+pow(y,2)) - R,2) +
pow(z,2)) - r)/r}

isosurface {
  function{
            //f_torus (x, y, z, 1, 0.1)
            Torus (x, y, z)
          }
  threshold 0
  contained_by {box {<-2,-2,-2>*2, <2,2,2>*2}}
  max_gradient 2
  accuracy 0.0001
  //evaluate 1,20,0.99
  texture { pigment{ color rgb <1, 0, 0>}
            //normal {bumps 0.5 scale 0.05}
            finish { phong 1}
   }
  //scale 0.80
  //rotate <0,-40,0>
 // rotate <-30,0,0>
  //translate < 0, 1.2, 0>
} // end of isosurface


Post a reply to this message

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