POV-Ray : Newsgroups : povray.binaries.images : Vortex pattern : Re: Vortex pattern Server Time
23 Apr 2024 22:34:08 EDT (-0400)
  Re: Vortex pattern  
From: Bald Eagle
Date: 13 Jul 2019 12:55:00
Message: <web.5d2a0c323717ac604eec112d0@news.povray.org>
Bill,

Here's what I am working with so far:

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

#declare Type = array [28-3] {
pigment {agate}, pigment {boxed}, pigment {bozo}, pigment {brick brick_size <4,
2, 3> mortar 0.25}, pigment {bumps},
pigment {cells}, pigment {checker rgb 0 rgb 1}, pigment {crackle}, pigment
{cylindrical}, pigment {dents},
pigment {gradient z}, pigment {granite}, pigment {hexagon}, pigment {leopard},
pigment {marble},
/*pigment {onion translate x*2},*/ pigment {quilted control0 0.5 control1 0.5},
pigment {radial frequency 7},
pigment {ripples}, pigment {spherical}, //pigment {spiral1 5 rotate x*90},
pigment {spiral2 4 rotate x*90},
pigment {spotted}, pigment {square rgb 0.6 rgb 0.3 rgb 0.0 rgb 1}, pigment
{triangular rgb 0 rgb 1 rgb 0.5},
pigment {waves translate x*10}, pigment {wood}, pigment {wrinkles}
}

#declare Pattern = function {
 pigment {
  Type[0]
 }
}

#declare Cos = function (X) {cos (X)};
#declare Sin = function (Y) {sin (Y)};
#declare Dist = function (x, y, z) {sqrt(x*x+y*y+z*z)}
#declare Inverse1 = function (x, y, z, R, S) {pow((R-Dist(x, y, z))/R, 1/S)}
#declare Inverse2 = function (x, y, z, R, S) {log( 1-Inverse1(x,y,z,R,S) )}

#declare Inverse =
function(x,y,z,R,S,T,B) {
 select (B, Inverse1 (x, y, z, R, S), Inverse2 (x, y, z, R, S))
}

#declare Vortex = function(x,y,z,R,S,T,B) {
 select (
 R - sqrt (x*x + y*y + z*z),

 Pattern(x,y,z).x,

 Pattern(
 (x*Cos(Inverse(x,y,z,R,S,T,B)*T*2*pi))-(z*Sin(Inverse(x,y,z,R,S,T,B)*T*2*pi)),
 0,
 (x*Sin(Inverse(x,y,z,R,S,T,B)*T*2*pi))+(z*Cos(Inverse(x,y,z,R,S,T,B)*T*2*pi))
 ).x


 )
}

#declare Radius = 10; // Maximum radius of effect
#declare Strength = 0.4; // Abruptness of effect at edges of radius
#declare Twist = 1;  // Proportion of 2*Pi, tau, 360 deg to rotate at center
(region of strongest twist)
#declare Blend = -1;   // -1 or 1 to select on of the two

plane {y, 0
 texture {
  pigment {function {Vortex (x, y, z, Radius, Strength, Twist, Blend)}
   color_map {
    [0.00 rgb <1.0, 0, 1>]
    [0.25 rgb <1.0, 0, 1>]

    [0.25 rgb <0.8, 1, 0>]
    [0.50 rgb <0.8, 1, 0>]

    [0.50 rgb <0.0, 1, 0>]
    [0.75 rgb <0.0, 1, 0>]

    [0.50 rgb <0.0, 0, 1>]
    [0.75 rgb <0.0, 0, 1>]
    }
  }
  finish {emission 0.5}
 }
}


So as you can see, in the Vortex function, I'm using the variable substitutions
from http://www.f-lohmueller.de/pov_tut/trans/trans_400e.htm to rotate around y

my Inverse functions are what I termed Blend, but I like Falloff a lot better.

I think that using .gray / .grey or at least .red might make things in the
function a bit clearer as to what's going on.


I'm going to try to apply a falloff from 1 to 0 in the y direction, and see if I
can't code up an isosurface scene that works with that...


Post a reply to this message

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