POV-Ray : Newsgroups : povray.binaries.images : Spiral Warps? : Re: Spiral Warps? Server Time
29 Apr 2024 01:30:22 EDT (-0400)
  Re: Spiral Warps?  
From: Bald Eagle
Date: 24 Jul 2018 21:05:00
Message: <web.5b57cc68aab4365c458c7afe0@news.povray.org>
In this next philosophical installment, I will address an aspect of this which I
had suspected, and speculate on the manner of successfully implementing a
desired pattern.

An equation may be expressed or visualized as a point, line, curve, or surface -
but a warp in the shape of that equation - I do not believe - can be obtained by
perturbing a pattern by that equation.

Instead, the pattern needs to be perturbed by the equation in reverse.  Or as
Mike Williams and POV-Ray, and Matrix Algebra would put it - as the inverse.

http://www.econym.demon.co.uk/isotut/substitute.htm

Shear
It's a bit more dificult to produce a particular shear transformation, because
the values that we need to use in the variable substitution need to be the
inverse of those normally used to generate the shear. We could calculate the
inverse of the transformation matrix by hand, but it is possible to get POV-Ray
to do it for us.

We first create a shear transformation, then declare a transformation function
using its inverse.

#include "transforms.inc"
#declare TR=Shear_Trans(<-0.5,0.5,0.5>,<1.1,0,-0.3>,<-0.3,0.5,0>)
#declare TRFI = function {transform {TR inverse}}

Now we can apply that transformation function to the unit vectors which gives us
the values we need for the substitution. However, we can't use vectors from
inside an isosurface function, so we have to extract the x, y and z values of
each of those vectors outside the isosurface.

#declare A=TRFI(1,0,0);
#declare B=TRFI(0,1,0);
#declare C=TRFI(0,0,1);

#declare Ax=A.x;#declare Bx=B.x;#declare Cx=C.x;
#declare Ay=A.y;#declare By=B.y;#declare Cy=C.y;
#declare Az=A.z;#declare Bz=B.z;#declare Cz=C.z;

We can now use these scalar values in the variable substitution.

function { F(Ax*x+Bx*y+Cx*z, Ay*x+By*y+Cy*z, Az*x+Bz*y+Cz*z) }

The image on the left shows two boxes. One of them is sheared by variable
substitution and the other is sheared with the equivalent conventional shear
transform.

The same method can be used for combinations of shear, rotation and scale
operations. It doesn't seem to work for transformations that involve
translation, but we already know how to do that.


https://www.mathsisfun.com/algebra/matrix-inverse.html

So, I have a few ideas as to the type of spiral / vortex that might be
interesting, however the specific type that I think might be currently sought
after is based on the Kelvin-Helmholtz instability.


https://nylander.wordpress.com/category/physics/fluids/
http://bugman123.com/FluidMotion/KelvinHelmholtz1.m1v
https://en.wikipedia.org/wiki/Kelvin%E2%80%93Helmholtz_instability

Understanding the concepts behind visualizing a vector field I think is
important here, as is bridging the gaps and filling in the missing steps of math
texts that leave you hanging.


Let's say we're talking about some time-dependent fluid dynamics equations that
describe the genesis of a cyclone.  Well, thinking about how that would _look_,
the points - the colors and textures and brightnesses of the pixels would move
along as the clock of the animation incremented.
I think the key to implementing a warp is doing exactly the opposite. The point
at time (t) needs to "inherit" the characteristics of the point in the equation
at t=0.

So, for the time being, I'll probably be (slowly) coding up inverse transforms,
trying out various spiral equations (entries welcome) and seeing if I can come
up with some sort of fairly functional Warp Lab / Playground.

If anyone has any experience in using Mathematica or Matlab, converting some of
the code on Nylander's page would be a nice boost forward.

If there are any computer graphics texts or sites explaining how to construct a
WARP in a texture - that would be some good reading as well.


Post a reply to this message

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