Tglad
Fractal Molossus
 
Posts: 703
|
 |
« on: August 18, 2012, 02:08:31 PM » |
|
Here's an idea I had... http://tglad.powweb.com/relativisticFractals.htmlIt takes normal escape-time folding fractals (KIFS), but makes it relativistic by using it on a 2+1 Minkowski space-time. The change is simple, just treat time as an imaginary number. While most fractals are symmetric at different scales, translations and rotations, these should also be symmetric at different velocities. Though it is hard to say whether it is succeeding just by looking at it. The time value is on a sine wave. Warning, it is quite primitive webGL code. Don't click on the cube or octahedron buttons unless your on small view and got flip enabled, as it slows down which causes an abort. Just load it and hit randomise to see different random folding planes (between 4 and 8 planes I think), and try out the check boxes. Feel free to steal the code (view source) if you want to adjust it.
|
|
|
|
|
Logged
|
|
|
|
|
Syntopia
|
 |
« Reply #1 on: August 24, 2012, 04:07:24 PM » |
|
Very interesting, and I'd like to depict the 2+1 Minkowski KIFS in spatial 3D (using a DE), instead of animated 2D, but I'm still a bit unsure about the generalizations:
- I'd expect the dot product to turn into something like dot(a,b) = a.x*b.x+a.y*b.y-a.z*b.z anywhere it is used (because of the metric change in the inner product), yet you still use unmodified dot products in the conditionals?
- The way you construct your tetra and cube are different from the formulas in Knighty's old thread. In this thread, points were reflected into the same region using symmetry planes of the polyhedra, requiring e.g. 3 folds for a tetra and 3 for the cube. Your approach seems to be using a larger number of reflection planes corresponding to the number of vertices in the polyhedra?
- The squared magnitude of a vector in relativity may be negative (time-like intervals), but I'm not sure how to interpret that when calculating the break-out condition. (I can see you choose to take the norm).
Also, what are the conformal transformations in Minkowski-space? Are boosts conformal? Are reflections? These questions are probably well-described, but I couldn't find some proper references.
|
|
|
|
|
Logged
|
|
|
|
|
weshoke
Guest
|
 |
« Reply #2 on: August 24, 2012, 11:02:50 PM » |
|
The best place to look for info on conformal operations in Minkowski space is in the Geometric Algebra literature. Here's the list taken from Geometric Algebra for Computer Science p. 476:
Reflection (in a plane, in a sphere, over a plane) Translation Rotation (around a line, around a circle) Scaling (aka Dilation) Transversion (which I think is the same as Boost, but am not 100%)
|
|
|
|
|
Logged
|
|
|
|
Tglad
Fractal Molossus
 
Posts: 703
|
 |
« Reply #3 on: August 25, 2012, 02:10:37 AM » |
|
Hi Syntopia, The fragment shaders only do normal dot products, so I re-formed the folds in terms of these normal ones. But here's the raw methods:
First define a plane by a single vector 'plane', which gives the fold position and (unnormalised) normal. In 3d Euclidean, a fold works like so, if (x - plane) dot plane > 0 x -= 2 * plane * ((x - plane) dot plane) / (plane dot plane) <-- reflection around the plane
In 2+1 Minkowski space it is exactly the same, but a dot b is a.x*b.x + a.y*b.y - a.t*b.t rather than the Euclidean dot product.
In 3d Euclidean, you exit when x dot x > threshold, in 2+1 Minkowski space it is the same, but using the Minkowski dot product.
Regarding the polyhedra, yes I'm using one reflection plane per face of the polyhedra. I forget how the old thread was doing polyhedra, I think it was using fewer planes but adding in a rotation to cover the full set of faces... you can do rotations in 2+1 space as two reflections. That might give better results I don't know.
Yes, the square magnitude can be negative, which means the current event (pos,time) is time-like (meaning it is within the light-cone). Positive is 'space-like', but I'm not sure how to interpret that. I tried a different colour for negative vs positive but didn't look so good, so I'm just using the abs. Possibly you could only exit on space-like being beyond the threshold, and allow any size negative mag squared. I haven't tried.
|
|
|
|
|
Logged
|
|
|
|
|
Syntopia
|
 |
« Reply #4 on: August 25, 2012, 09:03:01 AM » |
|
Hi Syntopia, The fragment shaders only do normal dot products, so I re-formed the folds in terms of these normal ones. But here's the raw methods:
First define a plane by a single vector 'plane', which gives the fold position and (unnormalised) normal. In 3d Euclidean, a fold works like so, if (x - plane) dot plane > 0 x -= 2 * plane * ((x - plane) dot plane) / (plane dot plane) <-- reflection around the plane
In 2+1 Minkowski space it is exactly the same, but a dot b is a.x*b.x + a.y*b.y - a.t*b.t rather than the Euclidean dot product.
Yes, I got that, but what I didn't understand is why the dot product isn't changed in the conditionals? e.g. you use: float d = dot(pos - p, p); if (d > 0.0) // then fold
Regarding the polyhedra, yes I'm using one reflection plane per face of the polyhedra. I forget how the old thread was doing polyhedra, I think it was using fewer planes but adding in a rotation to cover the full set of faces... you can do rotations in 2+1 space as two reflections. That might give better results I don't know.
There is no need for rotations and you have much less reflection planes all going through the origin, so it is quite a speedup. I have collected the DE for the platonic solids here: https://github.com/Syntopia/Fragmentarium/tree/master/Fragmentarium-Source/Examples/Kaleidoscopic%20IFS
|
|
|
|
|
Logged
|
|
|
|
|
Syntopia
|
 |
« Reply #5 on: August 25, 2012, 11:54:33 AM » |
|
I tried modifying a standard tetra 3D system, but the results are not that interesting - the DE doesn't seem to behave properly. Even for a simple system like a sphere, we get something like a double light cone, so the systems are not confined in space. Here is what I used in Fragmentarium: #include "DE-Raytracer.frag" #group Tetrahedron uniform float Scale; slider[0.00,2,4.00] uniform vec3 Offset; slider[(0,0,0),(1,1,1),(1,1,1)] uniform int Iterations; slider[0,13,100] uniform float Padding; slider[0,0,1]
// Symmetry planes of tetra vec3 n1 = normalize(vec3(1,1,0)); vec3 n2 = n1.xzy; vec3 n3 = n1.zxy;
// Minkowski inner product float dotM(vec3 a, vec3 b) { return a.x*b.x + a.y*b.y - a.z*b.z; }
void fold(inout vec3 z, vec3 normal) { float t = dotM(z,normal); if (t<0.0) { z-=2.0*t*normal; } }
float DE(vec3 z) { for (int n = 0; n< Iterations;n++) { fold(z,n1); fold(z,n2); fold(z,n3); z = z*Scale - Offset*(Scale-1.0); } float lz = sqrt(abs(dotM(z,z))); return (lz-Padding) * pow(Scale, -float(Iterations)); }
|
|
|
|
Logged
|
|
|
|
Tglad
Fractal Molossus
 
Posts: 703
|
 |
« Reply #6 on: August 26, 2012, 06:17:04 AM » |
|
For a fold that isn't offset, I do this: float d = dot(pos, plane); if (d > 0.0) // then fold { vec3 p2 = p; p2.z = -p2.z; pos -= 2.0 * p2 * d / dot(plane, p2); } so, defining z as time, think of the actual reflective plane as p2. So dot(pos, plane) is the same as dotMinkowski(pos, p2). then pos -= 2 * p2 * d / dot(plane, p2) is the same as pos -= 2 * p2 * d / dotMinkowski(p2, p2). which is reflection around p2.
For an offset fold, you can remove any vector from pos, I use d = dot(pos - plane, plane).
Your fold function will work only if your normalize is a normalizeMinkowski, i.e. normalizeMinkowski(vec v) { v /= sqrt(dotMinkowski(v, v)); } (and you couldn't swap axes between x,y and time without renormalising) Since dotMinkowski(v,v) can be negative you could end up dividing by some multiple of i. So it is easier to not normalize the normal and change the fold function to: float t = dotM(z, normal); if (t<0.0) { z-=2.0*t*normal / dotM(normal,normal); }
hopefully that will come up with something similar looking because I like the shape it produced! trippy.
|
|
|
|
« Last Edit: August 26, 2012, 06:22:05 AM by Tglad »
|
Logged
|
|
|
|
|
Syntopia
|
 |
« Reply #7 on: August 26, 2012, 10:28:16 AM » |
|
I think you're right, that for consistency my vectors should be normalized wrt minkowski metric. But for the tetra n2 and n3 have zero minkowski length, resulting in divide-by-zeroes, so that is not possible :-(
You use another set of planes, but don't you get the same problem, e.g. for the octahedron you have a plane, "ps[c++] = 0; ps[c++] =-s; ps[c++] = -s", which has zero length (dot(planes, p2)=0), right?
|
|
|
|
|
Logged
|
|
|
|
Tglad
Fractal Molossus
 
Posts: 703
|
 |
« Reply #8 on: August 26, 2012, 02:04:06 PM » |
|
Yeah the octahedron has some (0,s,s) type planes, maybe that's why it's all white until you hit mutate to wiggle the planes out of alignment a bit, I didn't think of that. I did a tetra using 4 opposite corners of a cube.
|
|
|
|
|
Logged
|
|
|
|
|