POV-Ray : Newsgroups : povray.general : Smooth Edged Spherical Pattern? : Re: Smooth Edged Spherical Pattern? Server Time
30 Jul 2024 06:22:39 EDT (-0400)
  Re: Smooth Edged Spherical Pattern?  
From: Tor Olav Kristensen
Date: 11 Jul 2009 09:48:56
Message: <4a589848@news.povray.org>
Tor Olav Kristensen wrote:
> Skip Talbot wrote:
> ...
>> Warp, I also tried your function and couldn't get it to show up.  
>> After getting a nice result with Alain's function I'm not going to dig 
>> too deeply into the math trying to get that function to work, but thanks.

Now maybe this could be interesting for you:

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version 3.6;

#include "colors.inc"

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare R = 2;

#declare pA = < R,  0,  R>;
#declare pB = <-R, -1,  R>;
#declare pC = <-R,  0, -R>;
#declare pD = < R,  1, -R>;

#declare Ax = pA.x;
#declare Ay = pA.y;
#declare Az = pA.z;
#declare Bx = pB.x;
#declare By = pB.y;
#declare Bz = pB.z;
#declare Cx = pC.x;
#declare Cy = pC.y;
#declare Cz = pC.z;
#declare Dx = pD.x;
#declare Dy = pD.y;
#declare Dz = pD.z;

#declare S = 1.0;

#declare Fn = function { exp(-S*(x*x + y*y + z*z)) }

#declare FnA = function { Fn(1.0*x, 1.0*y, 1.0*z) }
#declare FnB = function { Fn(0.5*x, 0.5*y, 0.5*z) }
#declare FnC = function { Fn(3.0*x, 1.0*y, 1.0*z) }
#declare FnD = function { Fn(1.5*x, 1.5*y, 1.5*z) }

isosurface {
   function {
     y
     + FnA(x - Ax, y - Ay, z - Az)
     - FnB(x - Bx, y - By, z - Bz)
     - FnC(x - Cx, y - Cy, z - Cz)
     - FnD(x - Dx, y - Dy, z - Dz)
   }
   max_gradient 4
   contained_by { box { -<100, 2, 100>, <100, 2, 100> } }
   pigment { color White }
}

light_source {
   <1, 2, -2>*100
   colour White*1.4
   shadowless
}

camera {
   location <0, 2, -3>*10
   look_at <0, 0, 0>
   angle 20
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

-- 
Tor Olav
http://subcube.com


Post a reply to this message

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