POV-Ray : Newsgroups : povray.advanced-users : DF3 density file generation for a generic 3D object ? : Re: DF3 density file generation for a generic 3D object ? Server Time
8 Jul 2024 18:48:30 EDT (-0400)
  Re: DF3 density file generation for a generic 3D object ?  
From: Alain
Date: 2 Oct 2007 10:18:01
Message: <47025319$1@news.povray.org>
Antonio Ferrari nous apporta ses lumieres en ce 2007/10/02 08:00:
> 
>> Aparently, you already have a function to eveluate the density. Taking that in
>> acount, it would be easier, and probably faster, to directly use that function
>> as density for a media.
>> interior{media{emission 1 density Your_Function}}
>> To increase the quality, you increase the samples value (default of 3). Don't
>> touch to intervals, inefficient and very slow.
>>
>> --
>> Alain
>> -------------------------------------------------
>> Just remember - if the world didn't suck, we would all fall off.
> 
> Hi Alain. First of all thank for you reply.
> 
> I explain better the problem...
> 
> Let suppose that the intersection of the object with a plane is (in 2D) as
> follows:
> 
>   @@@@@@@@@
>  @         @
> @           @
> @           @
>  @         @
>   @@@@@@@@@
> 
> Let's do our considerations in 2D, but they can be extended in 3D easily.
> 
>   @@@@@@@@@
>  @111111111@
> @12222222221@
> @123333333321@
> @12222222221@
>  @111111111@
>   @@@@@@@@@
> 
> What I'd want isn't a generic Your_Function with parameters x, y or z. What
> I want is a density function with only a parameter d, where d is the
> distance of the vector V=<x,y,z> from the contour of the surface, V inside
> the object. It's obvious that there are some preconditions to impose...
> 
> Look at the 2D section... Let's consider a linear density function.
> Your_Function conincide with the distance. So, for point at distance 1,
> density is 1; for points at distance 2, density is 2; and so on.
> 
> Does the line "interior{media{emission 1 density Your_Function}}" allow me
> to do what I'm expecting? Does it allow me to "follow" the contour of the
> object?
> 
> 
> 
If the object is an isosurface with a threshold of 0 and you use the same 
function for the density, the density will start at zero at the surface and go 
up as you move in. By exactly how much depends on the gradient of the 
function,but some scaling can do the trick. If the function is quadratic, taking 
it's square root will return a linear curve.

If you use some primitives, there are some patterns that can help. Those are 
spherical, boxed and planar.

spherical start at 1 at the origin and drop to zero at radius = 1.

boxed start at 1 at the origin and drop to zero when reaching 1 unit distance in 
any ortogonal direction.

planar start at 1 on the x-z plane and drop to zero at 1 unit along the y axis.

Those can be scaled, receive various wave shapes, be multiplied, divided, 
squared,...

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you're watching Bay Watch on the 
telly, see Pamela A. walking by and shout out "Great bump mapping!"


Post a reply to this message

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