News: Check out the originating "3d Mandelbulb" thread here

## The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!

 Pages: [1] 2 3 ... 7   Go Down
 Author Topic: A few formulas (For Luca... :D)  (Read 7691 times) Description: Who can change the name of this thread... :D 0 Members and 1 Guest are viewing this topic.
M Benesi
Fractal Schemer

Posts: 1075

 « on: October 25, 2015, 12:22:53 AM »

UPDATE:  For those of you who used the old formulas from this thread, I changed the names in this formula update.  Parameter files that you created using the old formula names will not work with the new formula names.  You can copy the parameters manually by having both formula names in your M3Formulas directory (folder).

BT1Pine
Pine 1.  The main formula, without bells and whistles.  It's transform 1 then a pine tree Mandelbulb.

BT1Pinegon  Same as above, allows rotations and polygonal transforms in between transform 1 and the pine tree Mandelbulb.  Rotations are before the circle to polygon transform.  If you want to try it in a different order... I'll explain below.

BT1Pinehedron  Similar to the Pinegon, it applies the polyhedral transform after T1 and the rotations, instead of the polygonal tranform.

BT2Pine  Pine 2.  Transform 2 then a pine tree Mandelbulb.  Combined so you don't have to use 2 formula slots.  Actually, you can use just transform2, instead of transform 2 and the pine tree Mandelbulb (this combined formula) but it's a bit different (of course!).

BPine_only  Just the Pine Tree Mandelbulb z^2.  Pretty plain.  I use BT1_Transform1, then other transforms, then this with only the x pixel component added in.

_BPolygonFromCircle     I'm going to update its functionality at some point.  For now, it transforms circles centered on the x axis into polygons.   I'm thinking about putting a rotation (and possibly translation) in all of the geometric space transforms, so that the axis the transform is completed around can be changed (so you can transform stuff around the y or z axes, or any arbitrary axis (vector)).

_BPolygonToCircle   This transforms regular polygons centered on the x axis with the midpoint of one face on the + y axis into circles.  It reverses the above transform.

_BPolyhedronFromSphere
Transforms a sphere into a polyhedron.  The only regular polyhedron created is a cube, the tetrahedron is stretched along the x-axis (compared to a regular tetrahedron), and the simple way this formula works doesn't allow for multiple face shapes to be generated specifically for the other Platonic solids.

_BPolyhedronToSphere  Inverse of the above transform.  Makes a polyhedron into a sphere.  Works with the Menger to make it into a sphere (if you use it correctly) because the Menger is a cube.  If you want to change the shape of a Menger into another polyhedron, do the above transform, followed by this one (with sides and sides2 both equal to 4), then the Menger (click "repeat from here" in the Menger formula tab).

_BStellahedronFromSphere   Stellated polyhedrons from sphere.  Still some work to be done, but it works nice with the BT1Pine, sides=6 , sides2=6, angle1~.9, angle2 ~???.

_BRotateFromMag  Rotate the whole coordinate system from the (-1,-1,-1) to (1,1,1) axis, to the x axis (-1,0,0)  to (1,0,0).

_BRotateToMag   The inverse of the above formula.  Use these formulas if you want to try doing something around the mag axis, and then want to apply it to the pine tree Mandelbulb (BPine_only).  So.. rotate to mag, do your stuff, rotate from mag, pine tree Mandelbulb (BPine_only).

_BSkewXmaxV1  This adds to or subtracts from the x component in various ways, based on various things, to distort the T1 pine tree Mandelbulb fractal types in nice ways.  This formula is not complete, and if I don't get distracted, there will be an update with altered parameters which will be named V2 or V1.1 depending on what I change.

_BT1_Transform1.  Rotate from x axis (-1,0,0) to (1,0,0), to magnitude axis  (-1,-1,-1) to (1,1,1).  Take absolute value.  Rotate back.  Multiply by scale, subtract offset from x.  Try this by itself, and Luca's switch YZ, if you want to see an asteroid.  Mix it with Mandelbulb or other formulas.  I'll have to add a BJustCoordinates.m3f so you can make a fractal out of just this transform- Mandelbulb 3D won't let you use just transforms to make an object, so if we make a "JustCoordinates" main formula, we'll be able to make things out of just the "transforms"....

_BT1_4D_clampXYZ  4 dimensional transform 1 which preserves the magnitude of x,y, and z so it doesn't introduce as much distortion to 3d fractals.

_BT1_4D_Transform1  4d transform 1.

_BT2_Transform2 makes the fractal "hollow", and gives you lots of neat little connected areas, and what not.

_BT3_Transform3  Similar to t3, a bit less continuous.

_BT4_Transform4  Similar to both the above.

Old formulas.rar has the old formula names, if you need them for some reason.
 BM3Formulas.rar (16.6 KB - downloaded 93 times.)  OLD Formulas.rar (21.52 KB - downloaded 82 times.) « Last Edit: November 23, 2015, 11:13:16 PM by M Benesi » Logged

M Benesi
Fractal Schemer

Posts: 1075

 « Reply #1 on: October 25, 2015, 12:23:53 AM »

never mind.  I'll zip em.

Here are a few images (from images showcase thread):

The 4th one is a bit better bigger.  Click any to enbiggen.

Parameters and formulas (for the above image) in this thread: http://www.fractalforums.com/index.php?topic=22123.msg87998#msg87998

I should make another parameter set... here is for the next one.  Need the formulas from the thread.

Code:
Mandelbulb3Dv18{
g.....s/...c3...w....2....kuN9SddYUvz0AGSDGiNA1EHZ0uiHI9qzfEGGXEmD0VzA2atMI6l5sj
................................OFppo6qBF.2........A./..................y.2...wD
...Uz6....U3/.../M.0/.....kj....3/....E3.....YhlfusQh1nD/..........m0dkpXm1....U
./....kD12../..........wz.................................U0.....y1...sD...../..
KwHFoN28Npq8zKiJopj.m.mDU.....o82.............sD.6....sD..G.....................
.............oAnAt1...sD....z...........................................D....k1.
.....Ksulz1.......kz.wzzz1.U..6.P....Y2...EB....a/...s/....F....6/...I1.....SF52
...U.0aZczDM6/nzMg2czX6dE16.0c..jeDk..UoK/nl2xvj6sM93P58iz1...........U.8.UQgk0.
.wUmc2beYz1.dA8E5Exwz0........../EU0.wzzz1...........s/...................E.2c..
zzzz.............0...................2./8.kzzzD............8....................
/EU0.wzzz1...................................UTVR..y3q/yzz/k.1A..1Ak.vzDsnwF.UDn
5VTzThdht0kaqaPiQs5y3q/.sLM5s1bTsLM5.UTVRUDlyVTVR..y3q/yMw5y3q/.sLM5snqTsLM5.UTV
RUDkzVTVR..y3q/y...y3q/bzz/k.1Akyz1yATomxzpaqaff................................
E.E..I.B/3U.....I....6....UEZtKNnZ4IdtKNlsqPNd3.................................
...................../.........E................................................
................................................................................
.....................2.....3....0....6INiJqQd/JOiJKA.waQhB1.....................
...............................E..........2.....................................
................................................................................
................................/....E/...U.....0JaPZBLOI7LMiBbNj7LPn.EOY/......
................................nAnAnAnAvznAnAnAnAnyz..................CD02.....
.UnX.1.................CD02......UnX.1..........................................
..........................................U.....I....6....UEZtKNnZ4IdtKNlsqPNd3.
...................................................../.........E................
................................................................................
.....................................................2.....3....0....6INiJqQdFZQ
VtqQaxaQh71....................................................E..........2.....
................................................................................
................................................................}
{Titel: doy5}

 « Last Edit: October 25, 2015, 12:34:49 AM by M Benesi » Logged

mclarekin
Fractal Senior

Posts: 1739

 « Reply #2 on: October 25, 2015, 02:21:16 AM »

Thanks for the concise breakdown of the transforms.  If I had only weighted a day, this would have saved me having to piece it together from the original post. LOL.

I sometimes use these transforms in conjunction with other common  transforms  to hollow out  mandelbulbs

// Spherical Offset  (has a  "scale" included to control the size.)

Code:
CVector3 temp = z;
double tempAuxDE = aux.DE;
double lengthTempZ = -z.Length();
z *= 1 + sphericalOffset.offsetRadius / lengthTempZ;
z *= sphericalOffset.scale;
aux.DE = aux.DE * fabs(sphericalOffset.scale) + 1.0;
// Box offset
Code:
{
CVector3 temp = z;
if (z.x > 0)
{
z.x = z.x + boxOffset.boxOffset.x;
aux.color += boxOffset.color.factor.x;
}
else
{
z.x = z.x - boxOffset.boxOffset.x;
aux.color += boxOffset.color.factor.x;
}
if (z.y > 0)
{
z.y = z.y + boxOffset.boxOffset.y;
aux.color += boxOffset.color.factor.y;
}
else
{
z.y = z.y - boxOffset.boxOffset.y;
aux.color += boxOffset.color.factor.y;
}
if (z.z > 0)
{
z.z = z.z + boxOffset.boxOffset.z;
aux.color += boxOffset.color.factor.z;
}
else
{
z.z = z.z - boxOffset.boxOffset.z;
aux.color += boxOffset.color.factor.z;
}
//weight function
if (boxOffset.control.weightEnabled)
{
z = SmoothCVector(temp, z, boxOffset.control.weight);
}
}
}
 Logged
mclarekin
Fractal Senior

Posts: 1739

 « Reply #3 on: October 25, 2015, 04:57:39 AM »

So I have transform1  called     BenesiMagTransform1 and I am wondering if this naming system would be appropriate for me to use on the four transforms?  There are now so many possibilities with these transforms that I will have to build a separate tab to run them all on. ( I was going to  just include them in an existing tab.)

Then I learn how to open a rar file ( I am new to Ubuntu) and open Transform1. I read your latest code and I note the changes and was wondering  is this one of those tricky mathematical "simplifications"  or an actual change in the formula.?

I am still exploring simply alternating  BenesiMagTransform1 code  and Pine Tree ( and other mandelbulbs) and adding other transforms, it may be weeks before I stop exploring and find time to code the other three  BenesiMagTransforms

As I have two z = z + (C * const.)  transforms on my tab I can set the first one to add x.pixel only for one iteration and have x,y,& z addition starting on second iteration, so at least that combination is easy for me to run. My DE gets bad on low powers so I may have to try Delta DE and /or drop the quality.  (Or more likely I have done something wrong!)

Code:
// STEP1: "Benesi transform 1"
tx=(x*sqrt(2/3)-z*sqrt(1/3))*sqrt(1/2);      //                  I note that  this block of code has changed?
z=abs(x*sqrt(1/3) + z*sqrt(2/3));
x=abs(tx-y*sqrt(1/2));
y=abs(tx+y*sqrt(1/2));

tx=x*sqrt(1/2)+y*sqrt(1/2);   //                optimise   tx =    ( x  + y ) *sqrt(1/2
y=-x*sqrt(1/2)+y*sqrt(1/2);  //                optimise  y =    ( x  + y ) *sqrt(1/2)
x=tx*sqrt(2/3)+z*sqrt(1/3);
z=-tx*sqrt(1/3)+z*sqrt(2/3);
x=scale*x-offset;  //scale =2    offset=2
y=scale*y;
z=scale*z;
 Logged
M Benesi
Fractal Schemer

Posts: 1075

 « Reply #4 on: October 25, 2015, 05:50:55 AM »

and I am wondering if this naming system would be appropriate for me to use on the four transforms?
hahaha...  I like it for numerous reasons.

Then I learn how to open a rar file ( I am new to Ubuntu) and open Transform1. I read your latest code and I note the changes and was wondering  is this one of those tricky mathematical "simplifications"  or an actual change in the formula.?
Tricky...  Luca did it.   And the part you were talking about optimizing is.. probably optimized already in the assembly portion of the code.  The (assembly language) code looked pretty tight to me.  The main slowdown in a lot of formulas is atan2, cos, sin, and the like.  So... ya know.

My DE gets bad on low powers so I may have to try Delta DE and /or drop the quality.  (Or more likely I have done something wrong!)
I haven't looked into DE too much- from what I recall, it doesn't like discontinuous functions, which I work with a lot.  That may be the problem.  I don't know the implementation in M3D, so...  I will play more.

 Logged

DarkBeam
Global Moderator
Fractal Senior

Posts: 2512

Fragments of the fractal -like the tip of it

 « Reply #5 on: October 25, 2015, 08:50:41 AM »

Ahh finally some order but too many formulas
Thanks so much but are they really necessary?
The transforms are ok. I would call BenesiPine0 the base formula (no folds) ... will look again later
 Logged

No sweat, guardian of wisdom!
mclarekin
Fractal Senior

Posts: 1739

 « Reply #6 on: October 25, 2015, 08:54:27 AM »

Quote
Tricky...  Luca did it.
Hmmmm, simplified by Luca the Trickster. That rearranging  maths blows my mind.!!   I am glad I don't have to do it.

Aha, yes! Discontinuous functions, I didn’t think about that.   So maybe there will not be a whole tab devoted to these formulas unless Buddhi  can spare the time.  I only know how to use basic DE.  The only active “real” programmers with Mandelbulber are Buddhi and Zebastian, and they already have a lot to do.  So it is unlikely that I will be able to replicate your amazing images just yet

Anyway, I am going to code everything up and add it to Mandelbulber (and I want to test it with the MengerSponge).     BenesiMagTransform1 is already  cool in Mandelbulber,  I just have to avoid too much discontinuity.
 Benesi Mag Hands.jpg (187.53 KB, 800x800 - viewed 286 times.) Logged
cKleinhuis
Fractal Senior

Posts: 7044

formerly known as 'Trifox'

 « Reply #7 on: October 25, 2015, 10:18:45 AM »

people, in my point of view the whole hybridisation process needs to be node based
in my tiny world a mandelbulb would consist of just the triplex formulas placed sequencially...
to be defined as node system and reusable as a base formula then ... and so on
 Logged

---

divide and conquer - iterate and rule - chaos is No random!
DarkBeam
Global Moderator
Fractal Senior

Posts: 2512

Fragments of the fractal -like the tip of it

 « Reply #8 on: October 25, 2015, 10:54:13 AM »

I have found on the net precise approximations  (eps is 10e-5) of sine and cosine using roundint() that at least in my pc are a lot faster than normal sin(). Interested?
Atan is also approximable
 Logged

No sweat, guardian of wisdom!
mclarekin
Fractal Senior

Posts: 1739

 « Reply #9 on: October 25, 2015, 12:42:00 PM »

Quote
to be defined as node system

At present all new Mandelbulber formulas are made from a sequential order of base transforms. So standard group:-  Mbox uses 4 i.e. boxFold, Spherical Fold, Scale and additionConstant.   Mbulb 2,  Quat 2.

So the iteration loop is made up of just single lines of code calling each base transform.

The complete trial formula is then made up with a selection of other transforms, as well as duplicate copies, so many combinations are possible to explore. Each transform  has an enable checkBox and stop/start iteration parameters.

The maybe mythical next stage is for building a loop with a dynamic array(s), where you drag & drop your transforms on the UI into your trial sequence.

But thinking nodes, hmmmm,  I start thinking, hmmmmmm,  it does not have to be just a single sequence. Node based thinking allows for parallel sequences of transforms, that can interact. Drag & drop & link  sounds much better. In OpenCL I tested running some transforms in parallel (learnt from chaosTube) then combining them as a weighted addition at some stage before the end of the loop (with only limited success). It would be much easier for me to test now that I can do some basic C++ code. The simplest form would have just simple Y joints to  “fork” and “combine”.  Easy to think about, but would take expertise and time.

@ Christian.  I am blindly assuming that is what a node system is

@ M.Benesi.   My detail level is bad. However, playing with all of BenesiMagTransformOne's variables,  produces all sorts of cool stuff when combined with mandelbulbs.  And I have  barely taken one step up the mountain of infinity)
 2 parts DarkBeam : 1 part Benesi.jpg (200.37 KB, 800x800 - viewed 260 times.) Logged
M Benesi
Fractal Schemer

Posts: 1075

 « Reply #10 on: October 25, 2015, 06:22:48 PM »

Ahh finally some order but too many formulas
Thanks so much but are they really necessary?
The transforms are ok. I would call BenesiPine0 the base formula (no folds) ... will look again later
I don't want to confuse people with too many options, but at the same time, each of the transforms create slightly different fractals.

If we make the options part of a single transform formula, which allows people to select which transform they want from within the formula, I think the formula will run slower because of the conditionals.  I've run into problems with if/then statements adding a lot of compute time- but I think it might have been the compiler I was using, so maybe doing it in assembly won't create that problem?.

So we could combine the transforms into one big formula, and then select which one we wanted to do from within the formula menu.

The only active “real” programmers with Mandelbulber are Buddhi and Zebastian, and they already have a lot to do.  So it is unlikely that I will be able to replicate your amazing images just yet

Anyway, I am going to code everything up and add it to Mandelbulber (and I want to test it with the MengerSponge).     BenesiMagTransform1 is already  cool in Mandelbulber,  I just have to avoid too much discontinuity.
Ohh, I didn't know you were using Mandelbulber- I must have missed you saying that- I was wondering about the look of the tabs you were posting, I thought you wrote/hacked your own version of M3D.

I have another formula to port to M3D (having problems with it!  assembly looks right!!  arghh...), but if I can compile code for Mandelbulber, I can probably port these formulas over after I get the stuff I am working on done.

people, in my point of view the whole hybridisation process needs to be node based
in my tiny world a mandelbulb would consist of just the triplex formulas placed sequencially...
to be defined as node system and reusable as a base formula then ... and so on
Well, these things don't have to be called Mandelbulbs.    We can call them Mandelbulb's redneck cousin, the Mandelbubba.
 Logged

cKleinhuis
Fractal Senior

Posts: 7044

formerly known as 'Trifox'

 « Reply #11 on: October 25, 2015, 07:10:42 PM »

Well, these things don't have to be called Mandelbulbs.    We can call them Mandelbulb's redneck cousin, the Mandelbubba.

no, if the result is a mandelbulb it is a mandelbulb, the redneck cousins would occur as soon as anything is changed in the order, formula or values, e.g. add a rotate formula inside the scale+rotate+translate triplex ordering
 Logged

---

divide and conquer - iterate and rule - chaos is No random!
M Benesi
Fractal Schemer

Posts: 1075

 « Reply #12 on: October 25, 2015, 09:10:24 PM »

So, here are images from the transforms by themselves (each with their own settings, because they are different).

T1, by itself is a cube... .

T1, with yz switched;  T2 (scale 3.7, offset 1);  T3 (scale 1.7, offset 1.7);  T4 (scale 2, offset 1);

So T2 and T4 are very similar (in fact, t3 may be adjustable to be like either!).  In fact... I'm thinking about T4 with different powers for the one part, because of something I saw Inigo Quilez do.

So.. not sure yet Luca.  Different math is different math- different results are good.  If T2 can be eliminated??
 Logged

mclarekin
Fractal Senior

Posts: 1739

 « Reply #13 on: October 26, 2015, 12:23:38 AM »

@ M.Benesi

Quote
if/then statements adding a lot of compute time-

yes it starts to add up (especially with fractals that run a lot of iterations before termination.)   Mandelbulber_extended formula tabs are great for testing and exploring, but not for rendering animations. So after exploring I would hard code in a formula with all redundant if() functions removed, then render the animation.

Quote
I thought you wrote/hacked your own version of M3D.

Haha.  Way, way, WAAAAAY! out of my ability. Maybe in my dreams.  LOL

Quote
but if I can compile code for Mandelbulber

I don't yet know about the Non-DE formulas in Mandelbulber,  but if you tested your formulas in Mandelbulber first before adding them to that incredibly long list of M3D formulas, it would save me  a lot of time LOL
Adding BenseiMagTransformOne  would take you guys about 15minutes. For me it takes a lot longer, plus all my code has to be thoroughly  checked by the "real" programmers.

If you can use QT creator in Ubuntu, you can download dev Version 2.06 and you would see how simple it is to add transforms  (The simplification of  transform inclusion has been added since the current V2.05 release.  )
 Logged
M Benesi
Fractal Schemer

Posts: 1075

 « Reply #14 on: October 26, 2015, 04:08:12 AM »

Well..  it would be a lot of work to shift stuff around, create a new partition, install Ubuntu, QT creator, etc.  Which I don't mind doing, but not feeling like jumping through those hoops at the moment.

If you've got an idea for an easier solution....    You know what.. I'll see if I can grab my dad's old laptop from him and install ubuntu on it.  It's slow...... but it works.  2 computers crunching fractals is better than one anyway, although I think it might be about half as fast as my 8 year old notebook that I'm working on now.

So I made a rotate to mag, and rotate back transform.  So you can do a Bulb, rotate to mag, do something along the lines of absolute value like one of the transforms, or maybe amazing box with absolute value or something, then rotate back.

What is weird is.. well, you'll see.

So the rotated one (I rotated and rotated back) change colors!  I'm wondering how M3D calculates colors... which I haven't explored yet.
 « Last Edit: October 26, 2015, 04:15:05 AM by M Benesi » Logged

 Pages: [1] 2 3 ... 7   Go Down