POV-Ray : Newsgroups : povray.binaries.images : Vortex pattern Server Time
6 Nov 2024 10:25:56 EST (-0500)
  Vortex pattern (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Bald Eagle
Subject: Vortex pattern
Date: 13 Jul 2019 12:05:01
Message: <web.5d2a00d41a6827c24eec112d0@news.povray.org>
So, I managed to get this applied to 25 patterns for illustration purposes.

I thought I broke it again, but it was just a bad bit of applying the texture
space to a box - which reminded me that I also wanted to put a y-component back
into the pattern.

This would then make a great pattern to use in an isosurface.  :)


Anyway - here they are, with some adjustment to scaling and a few translations
to nudge the appropriate ones over from the origin.


Post a reply to this message


Attachments:
Download 'vortex_warp.png' (827 KB)

Preview of image 'vortex_warp.png'
vortex_warp.png


 

From: Bald Eagle
Subject: Re: Vortex pattern
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

From: Bill Pragnell
Subject: Re: Vortex pattern
Date: 13 Jul 2019 20:05:01
Message: <web.5d2a706f3717ac601b6c6b3a0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Here's what I am working with so far:

Yes I see. Neat! When I get a chance to think about it, I daresay there are some
other cool things we can do with this sort of setup :)

Thanks for sharing!
Bill


Post a reply to this message

From: Thomas de Groot
Subject: Re: Vortex pattern
Date: 14 Jul 2019 02:39:31
Message: <5d2ace23$1@news.povray.org>
On 13-7-2019 18:52, Bald Eagle wrote:
> Bill,
> 
> Here's what I am working with so far:
> 

Way beyond my skills of course, but I am deeply impressed with your (and 
Bill's) work here. Keep it up!

-- 
Thomas


Post a reply to this message

From: Bald Eagle
Subject: Re: Vortex pattern
Date: 14 Jul 2019 15:25:02
Message: <web.5d2b81843717ac604eec112d0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> 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...

Right-o.
So I got the isosurface working with a pigment function, after Mike Williams'
invaluable site gave me the crucial function {} - 0.5 trick.

Then once I got the isosurface to display what was actually going on in 3D, I
realized that there was some rewriting needing to be done.  The quicky function
that I piggybacked onto BP's code resulted in a plane at y=0 that looked great,
but as my earlier attempts at displaying the 25 different patterns suggested,
and the isosurface confirmed, all was not well at y != 0.

The distance function was spherical, and IIRC, I had changed the rotated pattern
to cylindrical (y=0). That resulted in a weird sphere of rotated pattern inside
an empty cylinder, surrounded by the default pattern.

So I fixed all of that, and then had to limit the rotation to only take place in
the 0 < y < 1 region.  That made my head hurt for most of the morning.   Got
that straightened out, and then generalized it to 0 < y < Radius.

So then had to concoct some sort of way to take that little cylinder of space
and taper it so that it was full radius at y=1, and 0 radius at y = 0.

So I nested another select function inside the first, and used that to control
where there was twist, and where there wasn't.  After 6 or 8 petit mal
mathematical epileptic fits, and a trip to the laundromat (where I worked it out
in one last attempt) I got a usable equation for proof of concept.

Replacing Pattern(x,y,z).x with 0 gives me empty space where there is no twist,
thus having the isosurface model only the region where the effect is applied.

Then I reversed the outcomes to model only the default pattern with the affected
region missing, and gave that a mostly transparent pigment.

So here's what that looks like so far.

A better set of Falloff equations would be a useful toolkit for people to play
around more with this.

I think if I do 2 (4?) more isosurfaces with the .green and .blue components,
and a rgbf pigment, then maybe I can closely model the full-color pattern in 3D.
Or just do it in media with density patterns.

Anyway here's leopard scale 0.05 in a 4-unit cube with the twist effect in red.


Post a reply to this message


Attachments:
Download 'documentationfigures.png' (441 KB)

Preview of image 'documentationfigures.png'
documentationfigures.png


 

From: jr
Subject: Re: Vortex pattern
Date: 14 Jul 2019 20:10:00
Message: <web.5d2bc3cf3717ac603936914a0@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> ...
> Anyway here's leopard scale 0.05 in a 4-unit cube with the twist effect in red.

can this be used to make a "twister" (ie tornado)?  v nice.


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Vortex pattern
Date: 14 Jul 2019 20:55:00
Message: <web.5d2bcedc3717ac604eec112d0@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> can this be used to make a "twister" (ie tornado)?  v nice.

Sir, here at news.povray.org, we are always happy to receive your requests and
provide exactly these types of much anticipated solutions to highly desired
raytracing pattern problems.

I played around a bit in LibreOffice (for way too long), trying to add a bit of
pizzazz to my otherwise uninspiring YFalloff equation.

Using a _variable_ exponent, along with adding in a small constant in order to
keep the funnel above a certain minimum size was just the ticket.

I literally JUST got done coding this one up.   :)

Might be another one on the way to better illustrate the twister.


Post a reply to this message


Attachments:
Download 'documentationfigures.png' (131 KB)

Preview of image 'documentationfigures.png'
documentationfigures.png


 

From: Bald Eagle
Subject: Re: Vortex pattern
Date: 14 Jul 2019 21:20:01
Message: <web.5d2bd4653717ac604eec112d0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "jr" <cre### [at] gmailcom> wrote:
>
> > can this be used to make a "twister" (ie tornado)?  v nice.

> Might be another one on the way to better illustrate the twister.

I had to add a y-component to the pattern to add a twist along y, so now it not
only rotates, it _twists_.  I should probably add a control factor for that into
the formula.  :)


Post a reply to this message


Attachments:
Download 'documentationfigures.png' (84 KB)

Preview of image 'documentationfigures.png'
documentationfigures.png


 

From: jr
Subject: Re: Vortex pattern
Date: 15 Jul 2019 11:15:01
Message: <web.5d2c98663717ac603936914a0@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > "jr" <cre### [at] gmailcom> wrote:
> > > can this be used to make a "twister" (ie tornado)?  v nice.
> > Might be another one on the way to better illustrate the twister.
>
> I had to add a y-component to the pattern to add a twist along y, so now it not
> only rotates, it _twists_.  I should probably add a control factor for that into
> the formula.  :)

looks pretty awesome already, that twist really does it.  :-)  are the solid
bits (isosurface fragments?) solid as in can do meaningful 'inside()' tests?  I
ask because I'm thinking (convert to) DF3.


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Vortex pattern
Date: 15 Jul 2019 13:25:06
Message: <web.5d2cb6763717ac604eec112d0@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> are the solid
> bits (isosurface fragments?) solid as in can do meaningful 'inside()' tests?  I
> ask because I'm thinking (convert to) DF3.

So, the way I think it works is that my isosurfaces are open

but if you want to do CSG, you need to just do

isosurface {
.....

all_intersections

inverse // for some functions, I don't think all
// or maybe alternatively use the polarity keyword (vide infra)
}

http://wiki.povray.org/content/Reference:Isosurface

When the isosurface is not fully contained within the contained_by object, there
will be a cross section. When this happens, you will see the surface of the
container. Using the open keyword, these cross section surfaces are removed, and
the inside of the isosurface becomes visible.

Note: Using open slows down the render speed, and it is not recommended for use
with CSG operations.

Isosurfaces can be used in CSG shapes since they are solid finite objects - if
not finite by themselves, they are through the cross section with the container.
By default POV-Ray searches only for the first surface which the ray intersects.
However, when using an isosurface in CSG operations, the other surfaces must
also be found. Consequently, the keyword max_trace followed by an integer value,
must be added to the isosurface statement. To check for all surfaces, use the
keyword all_intersections instead. With max_trace it only checks until that
number is reached.

Note: The current implementation has a limit of 10 intersections in all cases.

By default, the inside of an isosurface is defined as the set of all points
inside the contained_by shape where the function values are below the threshold.
New in version 3.8 this can be changed via the polarity keyword. Specifying a
positive setting or on will instead cause function values above the threshold to
be considered inside. Specifying a negative setting or off will give the default
behavior.


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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