Logo by fractalwizz - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. March 29, 2024, 12:34:20 PM


Login with username, password and session length


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


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Binary box tiling (now solved)  (Read 837 times)
0 Members and 1 Guest are viewing this topic.
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« on: February 10, 2011, 11:31:54 AM »

 sad I was wondering about a new idea for a custom mapping but code it is harder than it seems fiery

The idea is explained in the image... Surely I do cheap errors as always! sad

(Needless to say; x=0 and y=0 in center of image. wink )


* binary.jpg (25.51 KB, 384x384 - viewed 216 times.)
« Last Edit: February 14, 2011, 04:02:36 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #1 on: February 10, 2011, 06:27:09 PM »

If I were you I'd work things out from the infinite limit of the top-left corner (i.e. top or left).

Assuming the coordinate system is normalised such that the height and width of the largest box is 1.0 then if the top-left (infinite limit) is taken as (0,0) then the bottom-right of the largest box is (2.0,2.0).
« Last Edit: February 10, 2011, 06:34:57 PM by David Makin » Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #2 on: February 12, 2011, 07:59:51 PM »

Thanks David. I surrended, an entire day lost trying and now I don't want to hear about this sh... never again. fiery
Logged

No sweat, guardian of wisdom!
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #3 on: February 13, 2011, 04:52:34 AM »

Assuming you follow my previous post then the size of the box that a given pixel is in is given by:

s = 2^(floor(log2(min(x,y))))

And the coordinates for the box of that size are:

u = x%s;    = mod(x,s) I think
v = y%s;    = mod(y,s)
x = x-u;
y = y-v;
u = u/s;
v = v/s;

Where the result x,y are the top-left coordinates of the required box (of side s) and u and v are the coords within the source box (of side 1.0) - just add 1.0 to u and v if the source to be used is actually the box that is at coords (1,1) to (2,2) rather than a separate input object.

Note that I'm assuming I'm correct in the above in thinking that floor(-0.5) is -1, floor(-1.75) is -2 and floor (1.5) is 1, if not then you need to change the "floor" to the correct function.
Also note that I haven't actually tested the above, I just give it as what I would try first.
Of course you'd need to adjust the algorithm or simply mirror/flip or rotate to get all 4 directions of the complete square of squares instead of just the top/left.
« Last Edit: February 13, 2011, 04:57:54 AM by David Makin » Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #4 on: February 13, 2011, 05:34:19 PM »

Maybe! But I am so sick and tired of trying that I don't want to try this ... Thanks anyway cheesy embarrass
Logged

No sweat, guardian of wisdom!
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #5 on: February 14, 2011, 10:11:41 AM »

 the wave the wave the wave

I analyzed again and again the problem, and finally the solution popped out!!! grin It was not so easy but now it works like a charm! UF version;

Code:
binarytil {
global:
  ;NOP
transform:
  complex px = @dcen+#pixel * @scale3
  float x=imag(px)
  float y=real(px)
  float LO=2^(-@startv)
  float HI = LO+LO*LO
  float k = -99
  float M = 99
  float swap = 99
  bool halt = false

   repeat      ; -----------
    M = abs(x)
    if abs(y)>M
    M = abs(y)
    endif
    if (M<HI && M>LO)
       halt = true
       if abs(x)>abs(y)
          k =  abs(x) / x
          x = (x - k * ( HI + LO ) * .5)* 2*@scale2 /( HI - LO )
          k =  abs(y) / y
          y = y* 1/( HI - LO )
          y = (y - trunc(y) - k * .5)*2*@scale2
       ; -----------
          elseif abs(y)>abs(x)
          k =  abs(y) / y
          y = (y - k * ( HI + LO ) * .5)* 2*@scale2 /( HI - LO )
          k =  abs(x) / x
          x = x* 1/( HI - LO )
          x = (x - trunc(x) - k * .5)*2*@scale2
       endif
    ; -----------
    else
    swap = LO
    LO = HI
    HI = HI + (HI-swap) * .5
    halt = (|HI-LO| <= |@cutoff| )
    endif
   until (halt)     ; -----------

  px = y+flip(x)
  #pixel = px*@scale - @dcen
default:
  title = "Binary tiling"
  complex param dcen
    caption = "Center shift"
    default = (0,0)
  endparam
  float param scale
    caption = "Outer scale"
    default = 2
  endparam
  float param scale2
    caption = "Inner scale"
    default = 1
  endparam
  float param scale3
    caption = "Overall scale"
    default = 1
  endparam
  float param cutoff
    caption = "Cutoff"
    default = 1e-20
  endparam
  int param startv
    caption = "Axiom"
    default = 0
    min = 0
    max = 8
  endparam
}

 cheesy cheesy cheesy


* binbox.jpg (207.89 KB, 912x650 - viewed 97 times.)
« Last Edit: February 14, 2011, 12:07:20 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
[SOLVED in Mandelbulb3Dv177]a wish for future version Mandelbulb 3d « 1 2 » PhotoComix 15 2403 Last post January 30, 2012, 11:49:15 AM
by bib
Brunnian Link Tiling Fractal Science Kit Gallery Ross Hilbert 0 1020 Last post May 08, 2015, 04:21:49 PM
by Ross Hilbert
Test re: Tiling problem Fragmentarium Gallery Sabine 0 636 Last post September 04, 2016, 09:56:23 AM
by Sabine
radial tiling Images Showcase (Rate My Fractal) floppyHat 0 1128 Last post November 19, 2016, 01:54:51 AM
by floppyHat
Hyperbolic tiling with golden ratio tiling pistil Images Showcase (Rate My Fractal) Dinkydau 5 1918 Last post March 09, 2017, 12:55:07 AM
by claude

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.184 seconds with 24 queries. (Pretty URLs adds 0.008s, 2q)