POV-Ray : Newsgroups : povray.binaries.images : Distant Haze - How To? Server Time
29 Mar 2024 02:25:48 EDT (-0400)
  Distant Haze - How To? (Message 12 to 21 of 21)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Sven Littkowski
Subject: Re: Distant Haze - How To?
Date: 27 Apr 2018 13:10:33
Message: <5ae35989$1@news.povray.org>
Interesting concept. Never thought about such. Will look into.

But meanwhile, I came to another idea and want to find out, if this can
be done with POV-Ray:

A torus-shaped media-based haze. A hollow torus, filled with a haze
media that is thickest at the center of the curved cylinder shape, and
invisible at the edges. Means, the media density_map needs probably to
have the shape of a torus, too, as Spherical and other shapes won't do
the trick in this particular case. That torus haze would be scaled to be
at the edge of the scene. This way, no influence of any other item would
occur.

Is such a torus-shaped media possible?

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

From: Sven Littkowski
Subject: Re: Distant Haze - How To?
Date: 27 Apr 2018 13:40:54
Message: <5ae360a6@news.povray.org>
Clipka, do you think, adding "torus" to the existing patters (spherical,
planar, cylindrical, and boxed) of density_maps would be useful and
possible?

I could imagine its usefulness for my horizon haze, but also for mighty
(nuclear or scifi) explosions (here also using Turbulence) as seen in
movies and documentaries.

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

From: Bald Eagle
Subject: Re: Distant Haze - How To?
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

From: clipka
Subject: Re: Distant Haze - How To?
Date: 27 Apr 2018 18:44:50
Message: <5ae3a7e2$1@news.povray.org>
Am 27.04.2018 um 19:40 schrieb Sven Littkowski:
> Clipka, do you think, adding "torus" to the existing patters (spherical,
> planar, cylindrical, and boxed) of density_maps would be useful and
> possible?

There is no such thing as "patterns of density_maps"; any pattern that
can be used with a pigment_map can also be used with a density_map.

Adding a torus pattern should be possible; however, it would have to be
specified what syntax to use to parameterize it (at least the ratio
between minor and major radius should be configurable; the major radius
could be specified by scaling the pattern), and whether the pattern
should continue /ad infinitum/ like `onion`/`wood`, or rather drop to
zero like `spherical`/`cylindrical`.

Also, it is questionable whether the use case is important enough to
warrant implementing a dedicated pattern, or whether the inbuilt
`f_torus()` function (accessible via `functions.inc`) combined with a
function pattern can be considered sufficient.


Post a reply to this message

From: Sven Littkowski
Subject: Re: Distant Haze - How To?
Date: 28 Apr 2018 02:18:36
Message: <5ae4123c$1@news.povray.org>
Thanks. I want to use this formula.

I am good with arts and creativity, but my weak point is, indeed,
complex types of mathematics, like this formula here. I am going to give
a try right away, and will find out where to put numbers (torus-related)
into this formula. And of course, I will post the resulting images here
in this thread. :-)

---

http://www.avg.com


Post a reply to this message

From: Thomas de Groot
Subject: Re: Distant Haze - How To?
Date: 28 Apr 2018 03:04:10
Message: <5ae41cea$1@news.povray.org>
On 27-4-2018 19:04, Sven Littkowski wrote:
> Can you show me a scene that uses this concept? I am curious. Big
> thanks! :-)
> 

Why don't you try it yourself? Take the basic POV-Ray scene and add the 
code. Then play with the settings. Nothing better than getting your own 
hands dirty.

-- 
Thomas


Post a reply to this message

From: Sven Littkowski
Subject: Re: Distant Haze - How To?
Date: 28 Apr 2018 03:53:57
Message: <5ae42895$1@news.povray.org>
Thanks for the answer.

I wonder, if the other users would want it.

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

From: Bald Eagle
Subject: Re: Distant Haze - How To?
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

From: Bald Eagle
Subject: Re: Distant Haze - How To?
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


 

From: Sven Littkowski
Subject: Re: Distant Haze - How To?
Date: 15 Jun 2018 21:33:55
Message: <5b246903@news.povray.org>
It actually looks beautiful! :-)

---

http://www.avg.com


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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