Alef


« on: January 22, 2013, 05:28:36 PM » 

Is it possible to have a solid 3D barnsley fern? There are one 2D fractal, who fascinated me when I discovered fractals, the Barnsley Fern. It have certain interesting properties. The most important is that Barnsley Fern looks perfectly as real life ferns, mysterious plants, who were stamped by the feets of dinosaurs. There are ru folk stories, that those, who would find ferns flowers ( golden shining and seen only in midsummer night) would find enermous riches and glory somewhat like of Holy Grail. It's not so suprising that PC can generate some mathematical figure, its more surpising when mathematical formula generates natural things. Broccollis is nice, but IMHO ferns are more complex and fascinating. A modification of Barnsley Fern that looks just like Christmas tree, important thing in modern western culture. Tannenbaum { ; Created from older IFS of unknown author ; by Edgar Malinovsky 0.024000 0.000000 0.000000 0.432000 0.011000 1.148000 0.0114 0.767883 0.014660 0.013403 0.839872 0.045542 1.678451 0.7083 0.058172 0.359455 0.429910 0.136618 0.653422 0.152845 0.1343 0.103733 0.370260 0.441029 0.214518 0.602863 0.404158 0.146 } by Apophysis Is it possible to have some modified KIFS forest of 3D Barnsley ferns and tannenbaums? IMHO, it would be more revarding than 3D mandelbrot. If you zoom into mandelbrot set you see more and more spirals. In 3D there are no such easy spirals, but there are number of coresponding curves, who wount be so easily observable. p.s. In searching for pictures I just found, that 'm not alone with this idea, and that it is pretty possible. So no new grail. Chaos and Graphics Realistic rendering 3D IFS fractals in realtime with graphics accelerators Tomasz Martyn, Institute of Computer Science, Warsaw University of Technology, ul Nowowiejska 15/19, 00665 Warsaw, Poland http://www.sciencedirect.com/science/article/pii/S0097849309001150


« Last Edit: January 22, 2013, 05:30:24 PM by Alef »

Logged

fractal catalisator





David Makin


« Reply #3 on: January 22, 2013, 11:01:31 PM » 

Of course potentially all LSystems are convertible to some form of IFS, so really the target should be results like the LSystems featured here: http://algorithmicbotany.org/papers/



Logged




Alef


« Reply #4 on: January 25, 2013, 03:31:49 PM » 

I was thinking about escape time barnsley fern integrated into major raytracers.
Tomasz Martyn in links above did IFS barnsley fern from raytracer friendly solid 3D primitives. Maybe this could be implemented in fragmentarium, too (but definetely not by me).
Well, but spruce is more interesting, as it is more culturaly important object.



Logged

fractal catalisator



laser blaster
Iterator
Posts: 178


« Reply #5 on: April 18, 2013, 04:12:51 AM » 

A chaos game style implementation of the 3D Barnsley would be really easy to pull off. For each location the point lands at, you would add a sphere. Then, you wold raytrace the sphere data. The only issue is finding a program that lets generate structures with a 3D chaos game. I've never tried it, but structure synth seems like the perfect tool for the job: http://structuresynth.sourceforge.net/On the other hand, writing a distance estimation formula for a 3D barnsley (for direct raytracing) would be far more difficult. IFS distance estimation is generally straightforward(at least conceptually)  just apply a series of conditional transformations to map subparts of the fractal onto the whole, in recursive way, then estimate the distance to the base shape after you're done iterating. However, the problem with the Barnsley Fern is that its fronds overlap, which is something the above method can't handle... I actually have an idea for how to go about writing a perfect Barnsley distance estimator... but I'll try to write a 2D version first, in Fragmentarium. I have a good feeling I'll be able to pull it off.



Logged




David Makin


« Reply #6 on: April 21, 2013, 12:44:59 PM » 

For affine 3D IFS there's also a way to implement Hart's method (intersecting viewing rays with attractor) on the GPU  for each point you need to traverse the entire IFS tree but only down to a given depth (based on detail/distance from viewpoint) and culling is quick based on bailout (distance of closest approach of viewing ray to bounding volume)  however the method I've used in my 3D IFS formula for UF is not suitable as that goes down the tree branches then back up and across (massive variations in code path from point to point), for efficient GPU you'd have to use an algorithm that goes across each row of the IFS tree instead, I've got it in my head such that no matter which branches get culled the code path will be unchanged but at the moment I've lost my programming mojo  haven't done a line for several weeks Of course this method is not as general as DE as it's useless for nonaffine IFS but it is considerably more optimum than using DE for complete IFS and slightly faster than using DE for KIFS when both are fully optimised.


« Last Edit: April 21, 2013, 12:50:48 PM by David Makin »

Logged




cKleinhuis


« Reply #7 on: April 21, 2013, 12:48:19 PM » 

lol, i never understood that david, do you have a paper at hand describing the hart's method



Logged


divide and conquer  iterate and rule  chaos is No random!



David Makin


« Reply #8 on: April 21, 2013, 12:55:59 PM » 

lol, i never understood that david, do you have a paper at hand describing the hart's method Here's a simplified version I just found  see section 3.41 onwards  it's not as detailed as the paper I've got somewhere here (on my PC from around 7 years ago) but I think you'll get the algorithm: http://www.cg.tuwien.ac.at/courses/Fraktale/PDF/fractals3.pdfIn my 3D IFS formula a lot of the initialisation code is setting the order in which the transforms appear in the IFS tree  this is because it goes down the tree first therefore the algorithm gives the closest transforms to the viewer/ray priority i.e. they come frst  that way any point found "on" the surface will be found as quickly as possible.


« Last Edit: April 21, 2013, 01:22:25 PM by David Makin »

Logged




cKleinhuis


« Reply #9 on: April 21, 2013, 01:48:05 PM » 

most excellent, thank you, arrh, although i do not have time for it i will set this post sticky!



Logged


divide and conquer  iterate and rule  chaos is No random!



phtolo


« Reply #10 on: June 30, 2013, 10:24:07 AM » 



« Last Edit: November 18, 2013, 09:18:14 PM by phtolo »

Logged




claude
Fractal Bachius
Posts: 563


« Reply #11 on: June 30, 2013, 09:52:01 PM » 

http://mathr.co.uk/misc/20130630_fern.jpgI actually have an idea for how to go about writing a perfect Barnsley distance estimator... but I'll try to write a 2D version first, in Fragmentarium. I have a good feeling I'll be able to pull it off. I tried to work out some of the maths in 2D today: http://mathr.co.uk/blog/20130630_distance_estimation_for_ifs_fractals.htmlThe older post I linked from there has a method for reducing time complexity from O(number of functions ^ number of iterations) to O(number of functions * number of iterations) but it does that by memoizing values in a texture (which isn't scalable to really huge images, nor 3D).



Logged




laser blaster
Iterator
Posts: 178


« Reply #12 on: August 18, 2013, 06:29:34 AM » 

Well, all these months later, I finally did write a 2D Barnsley distance estimator in Fragmentarium. Actually, it works far any affine IFS you plug into it. I've only bothered to code in support for 3 transformations, so I had to leave the stem out of my fern. Not surprisingly, adding support for overlapping parts slows the program down drastically, even when there are few overlaps. But that's partly because my implementation is boneheaded. I used a while loop to traverse down the IFS tree (using a for loop nested inside the while loop) over and over again, taking a slightly different path each time, until I can prove that a pixel is either inside or outside of the fractal. If it's outside the fractal, then I go several steps further down the tree, each time picking the path who's bounding rhombus is estimated to be the closet to the pixel, and calculate the resulting distance estimate (which still isn't completely accurate there are small discontinuities in the result). So, it needs a lot more work! Instead of starting from the top of the IFS tree each time I hit a dead end, I could trace back up it to the nearest untraveled branch by applying the inverse of the transformations, though I would need to restart from the top periodically to avoid losing too much precision. Or, I could even cache the last several positions of the iterated point. @David Makin: You're right, it would be far simpler and faster to intersect rays directly with a 3D IFS, rather than ray stepping with a distance estimator.



Logged




Alef


« Reply #13 on: August 18, 2013, 06:52:51 PM » 

Animation looks kind of magic. I like it. EDIT: I didn't tell the whole story about ferns. In lavian there are story about ferns having flowers shining of gold but just in single middsummer night, (a day of Johan the Babtist). And anyone who 'll found them will recieve magic luck or something like that. But outside of folklore seeking of fern flower are euphemism having s@x in day of John;)


« Last Edit: September 16, 2013, 06:08:29 PM by Alef »

Logged

fractal catalisator



cKleinhuis


« Reply #14 on: August 18, 2013, 07:03:14 PM » 

that animation is really funny and nice just too short



Logged


divide and conquer  iterate and rule  chaos is No random!



