POV-Ray : Newsgroups : povray.binaries.images : Spiral Warps? Server Time
25 Apr 2024 06:00:29 EDT (-0400)
  Spiral Warps? (Message 11 to 20 of 27)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 7 Messages >>>
From: Thomas de Groot
Subject: Re: Spiral Warps?
Date: 17 Jul 2018 07:38:43
Message: <5b4dd543$1@news.povray.org>
Not followed this through, but I begin to think that a solution might be 
found in the use of fractal patterns 
http://wiki.povray.org/content/Reference:Fractal_Pattern. Exponent 2 of 
the Julia set looks suspiciously like what you are looking for. No idea 
(yet) how to implement this however....

-- 
Thomas


Post a reply to this message

From: Alain
Subject: Re: Spiral Warps?
Date: 17 Jul 2018 11:05:31
Message: <5b4e05bb$1@news.povray.org>
Le 18-07-17 à 06:54, Kenneth a écrit :
> One idea would be to use POV-Ray's BOXED pattern-- with a pigment_map composed
> of *multiple* (averaged?) SPIRAL patterns inside it, each with some appropriate
> colors and warp{turbulence...}-- as a way to apply separate 'decals' to various
> places on the already-textured planet surface. (The 'outside' of the BOXED
> pattern(s) could fade to transparency, so as not to look like the storms are
> simply stuck on.) The idea is certainly not as 'realistic' as true fluid
> dynamics, but it might work.
> 

Instead of the boxed pattern, I'd use the shperical one. The, yes, use a 
spiral pattern, or a few averaged ones.
spiral 25 scale Something rotate Rotation


Alain


Post a reply to this message

From: Kenneth
Subject: Re: Spiral Warps?
Date: 17 Jul 2018 18:00:00
Message: <web.5b4e65ecaab4365ca47873e10@news.povray.org>
Alain <kua### [at] videotronca> wrote:

> >
>
> Instead of the boxed pattern, I'd use the shperical one....

Yes, that sounds better than a 'square' BOXED pattern.


Post a reply to this message

From: Bald Eagle
Subject: Re: Spiral Warps?
Date: 21 Jul 2018 14:00:07
Message: <web.5b53749daab4365c458c7afe0@news.povray.org>
> ...but how do I get realistic storm systems? The ones at "Seed of
> Andromeda" do not look very convincing, they would have to drag in
> clouds in a spiralling rather than a straight way (like with the
> black_hole warp of POV-Ray). Is there some trick to achieve a "spiral warp"?

So, I was clicking around on my new, minty-fresh Linux Mint install, and came
across the screen savers.  Most were written by Jamie Zawinski / jwz and the
source code for most or all of them are at:

https://www.jwz.org/xscreensaver/download.html

There are some very interesting ideas, implementations, and effects, and
"Distort" seemed to have a spiral effect.
The screen saver menu is a rich source of information, as each choice has a
description and URLs of articles on the web about the underlying system.

The specific URLs for the Distort screensaver were
https://en.wikipedia.org/wiki/Euler_equations_(fluid_dynamics)
and
https://en.wikipedia.org/wiki/Inviscid_flow

There are LOTS of very nice algorithms illustrated that have been talked abut
here in the forum, and might be likely to spark new interest in old topics.


Post a reply to this message

From: Bald Eagle
Subject: Re: Spiral Warps?
Date: 22 Jul 2018 09:15:00
Message: <web.5b548304aab4365c458c7afe0@news.povray.org>
This is just here for related brain and eye candy.
I was impressed by some of the tools that Mathematica has to process data, and
the manner in which the author sidesteps a roadblock or two with very practical
workarounds.

Enjoy  :)


Post a reply to this message

From: Mike Horvath
Subject: Re: Spiral Warps?
Date: 22 Jul 2018 10:45:26
Message: <5b549886$1@news.povray.org>
I have made some space and planetary scenes. A spiral warp would be nice 
for galaxies and hurricanes.


Mike


On 7/13/2018 6:35 PM, Jörg "Yadgar" Bleimann wrote:
> Hi(gh)!
> 
> Following a thread on Jupiter images on p.o-t, I started to model some 
> basic gas giant textures based on this (non-POV-Ray) tutorial:
>
https://www.seedofandromeda.com/blogs/49-procedural-gas-giant-rendering-with-gpu-noise

> 
> with color suggestions gleaned from here: 
> http://visions2200.com/Articles/ExtrasolarSpeculations.html (the chapter 
> "Color, Albedo and Temperature), I made a "cold Jovian" gas giant as 
> attached below...
> 
> ...but how do I get realistic storm systems? The ones at "Seed of 
> Andromeda" do not look very convincing, they would have to drag in 
> clouds in a spiralling rather than a straight way (like with the 
> black_hole warp of POV-Ray). Is there some trick to achieve a "spiral 
> warp"?
> 
> See you in Khyberspace!
> 
> Yadgar


Post a reply to this message

From: Bald Eagle
Subject: Re: Spiral Warps?
Date: 22 Jul 2018 16:35:00
Message: <web.5b54ea0aaab4365c458c7afe0@news.povray.org>
I think I found what looks to be some workable equations at:

https://people.sc.fsu.edu/~jburkardt/cpp_src/navier_stokes_2d_exact/navier_stokes_2d_exact.html


If you look at the png image, and then the source code for the vortex solution,
you'll notice that the code simply runs through an loop to evaluate the formula
over the <x, y> values of a unit square grid.
So, since POV-Ray "does the looping" when applying a pattern, that part of the
code is redundant, which just leave us with 3 equations.

The mental block is afflicting me with how to apply this, and how a warp is
different than a pattern.

(not having ever used gnuplot is a small problem as well)

Cue someone stepping in with the crayons and sock puppets to explain how I'd
make a spiral warp using functions, and how I'd visualize this.

Currently, my understanding is that a warp is akin to a translation or
phase-shift, where what's going on at the current point <x,y,z> is redefined as
what's going on at some other point, as defined by the code/function of the
warp.

I don't FULLY grasp the whole thing, so I'll try to describe it, and maybe
someone who sees the whole picture can correct me where I'm wrong.

I'll try to describe what I think happens in the following black hole warp code.
There's a "block" thing going on which I can only assume is for octants or
figuring out where in a repeat warp the black hole is being used.

Then in the actual application, you have a radius and a strength that are
specified.  So first, the distance of <x, y, z> from the center of the black
hole is determined.  Then that gets what I call "flipped" - if the distance is
1, it's now zero, and if it's 0, it's now 1.
That gets done in my illustrative function
#declare Limit = function {(Radius-Dist(x,y,z))...
and then it gets expressed as a proportion of the radius of the effect:
".../Radius}"
The result being that the black hole effect is strongest at the center, and
dropping off to zero near the radius.


#declare Radius = 0.2;
#declare Dist = function {sqrt(pow(x,2)+pow(y,2)+pow(z,2))}
#declare Limit = function {(Radius-Dist(x,y,z))/Radius}
#declare Warp = function {select( Limit(x,y,z), 0, 0, 1)}

that gets altered exponentially ...

.... and then the resulting scalar value gets used as a modifier of the <x, y,
z>, in Vector.h.

if we were physically moving points, this would be:

#declare Vector = <x, y, z>;
#declare NewVector = <x, y, z> + scalar * <a, b, c>;

Not really sure how vector <a, b, c> is defined, but let's keep that in the
black box for now.

But this is all mathematical, and the coordinates always stay the same, don't
they?  So what's really happening is that we're modifying the input of a pattern
or brightness or normal function so that it's behaving as if it were being
evaluated at another, point.  The FUNCTION is shifted by the warp.

If you look through Mike Williams' isosurface tutorial
http://www.econym.demon.co.uk/isotut/

the way to do this with a function is to "do the opposite"
to translate the effect in the +x direction, we subtract the translation from
the x term so that we are evaluating the function at (x-c).
Picture pulling a parabola, y=pow(x,2) to the right.
We grab the y value at (x-c) and pull it over to x, thus shifting it in the +x
direction.



I can only assume that if I want to model a warp, let's say as a density
function in a media (since that's been successful so far)
then I would use the warp to modify the effect of a pattern function.




The following is for a Black Hole Warp from warps.cpp:

case BLACK_HOLE_WARP:
Black_Hole = reinterpret_cast<BLACK_HOLE *>(Warp) ;
Assign_Vector (Center, Black_Hole->Center) ;

if (Black_Hole->Repeat)
{
/* first, get the block number we're in for each dimension  */
/* block numbers are (currently) calculated relative to 0   */
/* we use floor () since it correctly returns -1 for the
first block below 0 in each axis                         */
/* one final point - we could run into overflow problems if
the repeat vector was small and the scene very large.    */
if (Black_Hole->Repeat_Vector [X] >= EPSILON)
blockX = (int) floor (TPoint [X] / Black_Hole->Repeat_Vector [X]) ;

if (Black_Hole->Repeat_Vector [Y] >= EPSILON)
blockY = (int) floor (TPoint [Y] / Black_Hole->Repeat_Vector [Y]) ;

if (Black_Hole->Repeat_Vector [Z] >= EPSILON)
blockZ = (int) floor (TPoint [Z] / Black_Hole->Repeat_Vector [Z]) ;

if (Black_Hole->Uncertain)
{
/* if the position is uncertain calculate the new one first */
/* this will allow the same numbers to be returned by frand */

int seed = Hash3d (blockX, blockY, blockZ);
Center [X] += WarpRands(seed) * Black_Hole->Uncertainty_Vector [X] ;
Center [Y] += WarpRands(seed + 1) * Black_Hole->Uncertainty_Vector [Y] ;
Center [Z] += WarpRands(seed + 2) * Black_Hole->Uncertainty_Vector [Z] ;
}

Center [X] += Black_Hole->Repeat_Vector [X] * blockX ;
Center [Y] += Black_Hole->Repeat_Vector [Y] * blockY ;
Center [Z] += Black_Hole->Repeat_Vector [Z] * blockZ ;
}

VSub (Delta, TPoint, Center) ;
VLength (Length, Delta) ;

/* Length is the distance from the centre of the black hole */
if (Length >= Black_Hole->Radius) break ;

if (Black_Hole->Type == 0)
{
/* now convert the length to a proportion (0 to 1) that the point
is from the edge of the black hole. a point on the perimeter
of the black hole will be 0.0 ; a point at the centre will be
1.0 ; a point exactly halfway will be 0.5, and so forth. */
Length = (Black_Hole->Radius - Length) / Black_Hole->Radius ;

/* Strength is the magnitude of the transformation effect. firstly,
apply the Power variable to Length. this is meant to provide a
means of controlling how fast the power of the Black Hole falls
off from its centre. if Power is 2.0, then the effect is inverse
square. increasing power will cause the Black Hole to be a lot
weaker in its effect towards its perimeter.

finally we multiply Strength with the Black Hole's Strength
variable. if the resultant value exceeds 1.0 we clip it to 1.0.
this means a point will never be transformed by more than its
original distance from the centre. the result of this clipping
is that you will have an 'exclusion' area near the centre of
the black hole where all points whose final value exceeded or
equalled 1.0 were moved by a fixed amount. this only happens
if the Strength value of the Black Hole was greater than one. */

Strength = pow (Length, Black_Hole->Power) * Black_Hole->Strength ;
if (Strength > 1.0) Strength = 1.0 ;

/* if the Black Hole is inverted, it gives the impression of 'push-
ing' the pattern away from its centre. otherwise it sucks. */
VScaleEq (Delta, Black_Hole->Inverted ? -Strength : Strength) ;

/* add the scaled Delta to the input point to end up with TPoint. */
VAddEq (TPoint, Delta) ;
}
break;


Post a reply to this message

From: Bald Eagle
Subject: Re: Spiral Warps?
Date: 22 Jul 2018 17:10:01
Message: <web.5b54f1acaab4365c458c7afe0@news.povray.org>
Here's a real first stab at doing the right thing:


Post a reply to this message


Attachments:
Download 'spiralwarp.png' (263 KB)

Preview of image 'spiralwarp.png'
spiralwarp.png


 

From: Bald Eagle
Subject: Re: Spiral Warps?
Date: 22 Jul 2018 18:50:01
Message: <web.5b550926aab4365c458c7afe0@news.povray.org>
And I think this captures the essence of it.

Whee!


Post a reply to this message


Attachments:
Download 'spiralwarp.png' (62 KB)

Preview of image 'spiralwarp.png'
spiralwarp.png


 

From: Thomas de Groot
Subject: Re: Spiral Warps?
Date: 23 Jul 2018 02:40:26
Message: <5b55785a@news.povray.org>
On 23-7-2018 0:45, Bald Eagle wrote:
> And I think this captures the essence of it.
> 
> Whee!
> 

But.... concentric shells... those are /not/ storm patterns, are they? :-/

-- 
Thomas


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 7 Messages >>>

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