POV-Ray : Newsgroups : povray.advanced-users : Inline calculation for df3/media entries : Re: Inline calculation for df3/media entries Server Time
28 Jul 2024 12:25:04 EDT (-0400)
  Re: Inline calculation for df3/media entries  
From: Christoph Hormann
Date: 3 Nov 2005 11:34:52
Message: <dkde5u$qu4$1@chho.imagico.de>
Antonio Ferrari wrote:
> ops, I'm sorry but I sent my message without the subject...
> I repost it correctly.
> 
> I'd like to apply media to a generic object, so that media
> "intensity" is a function of the distance from the external
> surface (for example decrease/increase linearly/exponentially
> when distance grow up).
> 
> I don't know if this is a feature of Povray media. Is it
> possible?

No.  For some shapes (most notable spline based like prism and lathe) it 
is not possible to analytically calculate the distance to the surface. 
For others (like meshes) this can be extremely slow.

The IsoCSG library provides functions representing the distance from the 
surface of some basic shapes (plane, sphere, torus, box, cone/cylinder 
and triangle to be precise):

http://www.imagico.de/pov/ic/index.html

Functions for other shapes do not return the distance from the surface 
(although they might be sufficiently close to be used anyway).

> 
> Then... Do you think is it possible to write a macro that
> generate df3 entries according to the described rules?

Sure - writing a df3 using SDL file writing functions isn't possible 
though, you will need to do some external conversion.  And it will be 
quite slow.

Note Gilles Tran's makeclouds uses a similar technique but not with a 
macro but using 'slice' renders of the object:

http://www.oyonale.com/ressources/english/sources13.htm

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 31 Oct. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

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