POV-Ray : Newsgroups : povray.advanced-users : Density in an object Server Time
24 Nov 2024 14:52:12 EST (-0500)
  Density in an object (Message 1 to 4 of 4)  
From: McHannemann
Subject: Density in an object
Date: 30 Apr 2006 05:20:00
Message: <web.4454810ad7fc4fc6ae72cf340@news.povray.org>
Hi,

I would like to do the following:
to have a object with media inside, where the density of the
media is controlled by the x,y,z so that the max density is reached
at 0,0,0 and the minimum at the border of the object?

any ideas?

Regards,

Thor


Post a reply to this message

From: Warp
Subject: Re: Density in an object
Date: 30 Apr 2006 06:49:03
Message: <4454961f@news.povray.org>
McHannemann <nomail@nomail> wrote:
> I would like to do the following:
> to have a object with media inside, where the density of the
> media is controlled by the x,y,z so that the max density is reached
> at 0,0,0 and the minimum at the border of the object?

  For any given object? Not possible. (At least not at any reasonable speed.)

  If it were, it would be the holy grail of raytracing.

-- 
                                                          - Warp


Post a reply to this message

From: Klemen
Subject: Re: Density in an object
Date: 1 May 2006 12:20:01
Message: <web.4456345e46d71bd927caf3dc0@news.povray.org>
"McHannemann" <nomail@nomail> wrote:
> Hi,
>
> I would like to do the following:
> to have a object with media inside, where the density of the
> media is controlled by the x,y,z so that the max density is reached
> at 0,0,0 and the minimum at the border of the object?
>
> any ideas?
>
> Regards,
>
> Thor

Well, you could try to make a density file by randomly shooting out rays
from the given point and sampling along that path, writing the density
value to a 3d density file, then reading that back in as a .ds3 file.
Haven't tried that, though, but there is a galaxy.pov file in the samples
which has structure like that.

But, like Warp said, it would be slow. Very. Especially when you first
generate the density file. After that, it depends on your raytracing
quality settings.


Post a reply to this message

From: Alain
Subject: Re: Density in an object
Date: 1 May 2006 19:22:38
Message: <4456983e$1@news.povray.org>
McHannemann nous apporta ses lumieres en ce 30/04/2006 05:19:
> Hi,
> 
> I would like to do the following:
> to have a object with media inside, where the density of the
> media is controlled by the x,y,z so that the max density is reached
> at 0,0,0 and the minimum at the border of the object?
> 
> any ideas?
> 
> Regards,
> 
> Thor
> 
> 
> 
If your object is basicaly a sphere, maybe distorted, you can use the spherical
pattern.
If it's close to a box, then you can use the boxed pattern.
In the case of a cylinder, you have the cylindrical pattern.
You also have the planar pattern.
All goes from one in the center and decrease to zero at 1 unit. spherical is relative
to the origin, 
cylindrical is along the y axis, planar along the x-z plane and boxed fits an unit
cube. You need to 
scale, rotate, translate to place the patterns correctly relative to your container.

If your shape is an isosurface, you may, at least in several cases, use the same
function for your 
density. This will take a lot more time to render than the previous patterns.
It will work *IF* your function start high inside the isosurface and decrease when you
mover away 
*AND* you use a thresshold value of zero (0).

-- 
Alain
-------------------------------------------------
Utopianism: This shit does not stink.


Post a reply to this message

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