POV-Ray : Newsgroups : povray.newusers : How to: Sphere with 3D Electric Field Lines : Re: How to: Sphere with 3D Electric Field Lines Server Time
11 May 2024 23:29:18 EDT (-0400)
  Re: How to: Sphere with 3D Electric Field Lines  
From: Johann
Date: 5 Oct 2014 06:35:00
Message: <web.54311e84266802cb16298ca60@news.povray.org>
>
> To become something like this:
>
> union {
>    #while (PosX < 1.0)
>      #declare PosY=-0.5;
>        #while (PosY < 0.5)
>          #declare Pos=<PosX, PosY, 0>;
>          #declare Vgrd=vGradient(Fn04normalized, Pos);
>          #declare Vgrd=<Vgrd.x, Vgrd.y, 0>*0.1;
>          #if (vlength(Vgrd)<0.300)
>      union{
>            cylinder {
>              <PosX, PosY, 0>-Vgrd*0.105,
>              <PosX, PosY, 0>,
>              0.001}
>  cone{
>     <PosX, PosY, 0>,0.03,
>     <PosX, PosY, 0>+Vgrd*0.105, 0}
>              texture {
>                pigment { color srgb y*Gradient_Length(Fn04normalized,
> Pos)*0.25 }
>              }
>            }
>  cone{<PosX, PosY, 0>,0.03, <PosX, PosY, 0>+Vgrd*0.105, 0}
>          #end
>          #declare PosY=PosY+Spacing;
>        #end
>      #declare PosX=PosX+Spacing;
>    #end
> }
>
> Now, one half of each lines stay the same while the other half is
> replaced by a cone. They are placed in an union so that they can get the
> pigment in one statement.
>
>
> Alain

Although it looks a little bit strange the result ( a mix of polygons and
arrows), I really thank you for your help!

Johann


Post a reply to this message

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