POV-Ray : Newsgroups : povray.binaries.images : Example images for the related post: "Rendering an electromagnetic field an= : Re: Example images for the related post: "Rendering an electromagnetic fiel= Server Time
14 May 2024 08:55:43 EDT (-0400)
  Re: Example images for the related post: "Rendering an electromagnetic fiel=  
From: cbpypov
Date: 31 Oct 2017 16:45:00
Message: <web.59f8e0b1231a9fe3dbe4ba980@news.povray.org>
>
> No way around this except re-compiling POV-Ray with tweaked constant sizes.
>

OR Python :)

-----------------------------------------------------------------------------

Hey all,

sorry for the delay. I see there are no more suggestions regarding the residual
problems :) That's ... exactly what I found out too: these problems might not
(or hardly) be addressable in POV-Ray. But in Python :)

However, it does not mean that they cannot be solved _at all_, right?

So I did. Somehow I was blind and kept on tweaking my POV-code over and over,
but the problem was simply that the data defined in this hexagonal unit cell.
Which is just unfavorable for the POV-rendering.

What I did (in very brief):

I threw away field values which are exactly 0.0, so that I have the field in
really only the hexagonal unit cell. Afterwards, I tiled the data on a hexagonal
grid and used an interpolator to achieve a regularly gridded data set in the
whole range where I wanted to show the field. Then I exported it to three
df3-files (for each of R, G, B) as before.

The same was done for the emitters: I randomly chose the emitter locations in
the part of the unit cell I desired, tiling them and choosing new ones on every
tile. So this gives me a completely random distribution of emitters in the whole
data range, -- not like before a repetitive pattern of randomly chosen emitters
in the unit cell only.

From these coordinates, I calculated the density using a sum of the spherical
exponential decays for _each_ emitter directly in Python as well. So this is
just another df3 for the emitter auras, i.e. intensities giving me a fourth
medium in the POV-scene.

So I end up with only 4 df3 files, circumventing any of the low-level problems
in POV-Ray, -- while still allowing to set the aura and field brightness in the
scene independently. Moreover, the auras and the field can be interpolated in
the POV-scene in one step!

As a result, I only have a minimal number of well-defined input files, the code
is much more elegant, and all the problems are gone :)

There is a small, low-Q render in the attachment. I'll post the complete code,
input files and high-Q render once I'm done. The attached render has some shifts
between the auras and the emitter spheres because it uses a very coarse data set
(will be gone when the fine one is ready: the interpolation and density
computation takes some time... it's running). The field cut-off at the front is
because I used a small data set for testing.

IMPORTANT
---------

I AM REALLY GRATEFUL, for all your help and for sharing this knowledge with me!
I'd like to include those of you who contributed so much of their free time into
my thesis acknowledgments. Could you elaborate on how (and if) you want to
appear there? :)


Post a reply to this message


Attachments:
Download '20171101_scene1_lowq.png' (340 KB)

Preview of image '20171101_scene1_lowq.png'
20171101_scene1_lowq.png


 

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