POV-Ray : Newsgroups : povray.general : Rendering an electromagnetic field and photon rays : Re: Rendering an electromagnetic field and photon rays Server Time
15 May 2024 10:08:51 EDT (-0400)
  Re: Rendering an electromagnetic field and photon rays  
From: Bald Eagle
Date: 26 Oct 2017 16:05:01
Message: <web.59f23f639b56bbddc437ac910@news.povray.org>
"cbpypov" <nomail@nomail> wrote:

> Hi Tor Olav,
>
> thank you very much for pointing that out! I had a look at the files, but
> somehow I cannot figure out how to find anything that helps me :( Maybe I don't
> have enough practice in Pov-ray coding, I think you all would call me an
> absolute beginner. So I see how far I can go with Bald Eagles suggestions and
> maybe it is better to discuss some code of mine (I'll try to post better code
> next time :) )

TOK, thanks for posting that link - I had forgotten about that scene and how it
was rendered.  As a [former] chemist, it's one I remember well!  :)

Ignore most of the top part of that scene, as it's mostly just setting up the
quantum mechanical spherical harmonics for the different wave functions of the
electron orbital shells.
So, basically there's a lot of stuff, and then that all gets boiled down to a
function. I posted the line from Jaap's code in my last post showing how he uses
that function to shape his media rather than the spherical function.

The spherical function is of course sqrt( pow(x,2)+pow(y,2)+pow(z,2))-Radius = 0

#declare Fade = function {Radius - sqrt( pow(x,2)+pow(y,2)+pow(z,2))}

ought to give you scalar values that start at Radius and fade to zero at the
radius of the sphere.  Use that as your density function [for now] ;)


Post a reply to this message

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