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
7 Jun 2024 13:57:18 EDT (-0400)
  Re: Example images for the related post: "Rendering an electromagnetic fiel=  
From: cbpypov
Date: 27 Oct 2017 14:10:01
Message: <web.59f375c3231a9fe3306cf3e40@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> I had that as part of a mental list to post, but it slipped off...
>
> I was also thinking that if you wanted to represent an emission, you ought to
> use the standard lambda-photon-sine-wave thing
>
> like
> https://physics.aps.org/assets/5f985b1a-28d8-4cb1-89f1-1ae7dedeac6f/e135_2_thumb.png
>
> Just define it as an object that you can replace that quickie Vector () with.
>
> And now I'm off to lunch.


So for the fast case I managed to get rid of the overlap by defining the field
directly in a prism that I scale to the unit cell size, like this

#declare Field_object = prism {
    linear_sweep
    linear_spline
    0., // sweep the following shape from here ...
    1., // ... up through here
    7, // the number of points making up the shape ...
    <0.,0.5>, <0.25,1.>, <0.75,1.>, <1.,0.5>, <0.75,0.>, <0.25,0.>, <0.,0.5>

    texture {
     finish { diffuse 0 ambient 0 reflection 0 }
     pigment {
       colour rgbft <1.000,1.000,1.00,0.000,1.000>
     }
    }

    hollow
    interior{
     ior                 1.000
     caustics            0.000
     dispersion          1.000
     dispersion_samples  7.000
     fade_power          0.000
     fade_distance       0.000
     fade_color          rgb <0.000,0.000,0.000>

     // Red
     media {
       method     3
       intervals  10
       samples    1, 1
       confidence 0.900
       variance   0.008
       ratio      0.900
       absorption rgb <0,0,0>
       emission   rgb <1,0,0> * Field_brightness
       aa_threshold 0.050
       aa_level    4
       density {
         density_file df3 "efield_energy_in_superspace_R.df3"
         interpolate Field_interpolation
       }
     }

     // Green
     media {
       method     3
       intervals  10
       samples    1, 1
       confidence 0.900
       variance   0.008
       ratio      0.900
       absorption rgb <0,0,0>
       emission   rgb <0,1,0> * Field_brightness
       aa_threshold 0.050
       aa_level    4
       density {
         density_file df3 "efield_energy_in_superspace_G.df3"
         interpolate Field_interpolation
       }
     }

     // Blue
     media {
       method     3
       intervals  10
       samples    1, 1
       confidence 0.900
       variance   0.008
       ratio      0.900
       absorption rgb <0,0,0>
       emission   rgb <0,0,1> * Field_brightness
       aa_threshold 0.050
       aa_level    4
       density {
         density_file df3 "efield_energy_in_superspace_B.df3"
         interpolate Field_interpolation
       }
     }
     media {
       absorption 0.
     }
    }

    // Set proper size and position
    scale field_box_dim
    translate field_box_trans
}

But still a problem is that the "black" parts of the color map are not
transparent (maybe because the density is not exactly 0.0?). So there is a kind
of "box" still visible, which destroys the complete image. See the attachment.
Help! :)

For the emitter thing: yes that "standard lambda-photon-sine-wave thing" would
really be a great thing to have ... er ... how do I do that? :)


Post a reply to this message


Attachments:
Download 'phc_and_excitation_enhancement.png' (250 KB)

Preview of image 'phc_and_excitation_enhancement.png'
phc_and_excitation_enhancement.png


 

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