POV-Ray : Newsgroups : povray.binaries.images : Distant Haze - How To? : Re: Distant Haze - How To? Server Time
28 Apr 2024 20:56:03 EDT (-0400)
  Re: Distant Haze - How To?  
From: Bald Eagle
Date: 29 Apr 2018 21:55:00
Message: <web.5ae6776fdf4237795cafe28e0@news.povray.org>
So, did a quick and dirty experiment, where I just looped the threshhold values
for the isosurface from 0 to 1, and varied the color through the HSV angle, and
it appears that 0 is the inner torus (for the POV-Ray f_torus function)

Haven't had the time to experiment any more, but curious about my own function.

The idea would be to just lay down nested tori, with a noise function applied,
to generate the media function.

Probably also lots faster if i break it up like I did the initial spiral
experiments for Kenneth, plotting spheres for data points in the x/y/z array.

'till tomorrow...

---------------------------------------------------------------
#version 3.7;
global_settings {assumed_gamma 1.0}

#include "colors.inc"
#include "functions.inc"
#include "shapes.inc"
#include "shapes2.inc"
#include "Bounding_Box.mcr"

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}

#declare Tori = //intersection {

 //box {<-R*2, -r*2, 0>, <R*2, r*2, R*2> pigment {rgbt 1}}
union{
 #for (V, 0, 1, 0.2)
  #declare Current = CHSV2RGB(<V*180, 1, 1, 0, 0.8>);
  #debug concat ( " V = ", str (V, 3, 1),  "\n")
  isosurface {
    function{
     f_torus (x, y, z, R, r)
     //Torus (x, y, z)
    }
    threshold V
    contained_by {box {<-R*2, -r*2, -R*2>, <R*2, r*2, R*2>}}
    max_gradient 2
    accuracy 0.0001
      evaluate 1,20,0.99
      open
    texture {pigment {color rgbft Current}
     //normal {bumps 0.5 scale 0.05}
     //finish {phong 1}
    }
    //scale 0.80
    //rotate <0,-40,0>
    //rotate <90,0,0>
    //translate < 0, 1.2, 0>
  } // end of isosurface
 #end // end for V
}


object {Tori}

//Loc (Tori, 0.01, yes) // my bounding box macro


Post a reply to this message


Attachments:
Download 'torus_function.png' (181 KB)

Preview of image 'torus_function.png'
torus_function.png


 

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