Title: having troubles with 3D IFS Post by: yoniHorn on July 05, 2010, 05:28:10 PM so i want to build a 3D IFS simulator.
i've already built an 2D ifs, and it's works great(download here: http://sites.google.com/site/yonisprogs/programs/IFS.rar) and the 3D system is all set up , after i've built my 3D Function Drawer (download here: http://sites.google.com/site/yonisprogs/programs/3DFunctionDrawer.rar ) for those who are not new in IFS, i think i'll mange to produce a 3D IFS but for some reasons after some time of searching i can't find even 1 example of it! (I'm not talking about an image I'm talking about the functions!) I'm looking for the Affine Transformations. In 2D the Affine of the famous fern is: w a b c d e f p ƒ1 0 0 0 0.16 0 0 0.01 ƒ2 0.85 0.04 −0.04 0.85 0 1.6 0.85 ƒ3 0.2 −0.26 0.23 0.22 0 1.6 0.07 ƒ4 −0.15 0.28 0.26 0.24 0 0.44 0.07 (source: http://en.wikipedia.org/wiki/Barnsley_fern) I just need an example so i can start generation the IFSs. thank you very much, Yoni. Title: Re: having troubles with 3D IFS Post by: Timeroot on July 05, 2010, 06:00:10 PM Ahh, cool! I didn't read your source code, but I'm guessing you've only implemented affine transformations... From what I know, I guess these follow something like
xNew=a*x+b*y+c*z+d; yNew=e*x+f*y+g*z+h; zNew=i*x+j*y+k*z+l; Maybe something like Sierpinksi pyramid/tetrahedron would be good... I think that would be w a b c d e f g h i j k l p f1 0.5 0.5 0.5 0 0.5 0.5 0.5 0 0.5 0.5 0.5 0 0.25 f2 0.5 0.5 0.5 .5 0.5 0.5 0.5 0 0.5 0.5 0.5 0 0.25 f3 0.5 0.5 0.5 0 0.5 0.5 0.5 .5 0.5 0.5 0.5 0 0.25 f4 0.5 0.5 0.5 0 0.5 0.5 0.5 0 0.5 0.5 0.5 .5 0.25 Note that this won't give you an *equliateral* Sierpinksi pyramid, more a sort of right-angled sierpinksi pyramid. Another simple formula. to make a Menger sponge: w a b c d e f g h i j k l p f1 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.05 f2 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.33 0.33 0.33 0.33 0.05 f3 0.33 0.33 0.33 0 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0 0.05 f4 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.05 f5 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.05 f6 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.05 f7 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.05 f8 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.05 f9 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.05 f10 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.05 f11 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.33 0.05 f12 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.33 0.33 0.33 0.33 0.05 f13 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.33 0.05 f14 0.33 0.33 0.33 0 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0.66 0.05 f15 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0.66 0.05 f16 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0 0.05 f17 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.05 f18 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.05 f19 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.05 f20 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.05 Uh, yeah. I think that's it. I haven't tested it though. Happy fractaling! Title: Re: having troubles with 3D IFS Post by: cKleinhuis on July 05, 2010, 06:33:02 PM lol, i hope you wrote that numbers directly from your mind :D
Title: Re: having troubles with 3D IFS Post by: yoniHorn on July 05, 2010, 07:31:21 PM Ahh, cool! I didn't read your source code, but I'm guessing you've only implemented affine transformations... From what I know, I guess these follow something like xNew=a*x+b*y+c*z+d; yNew=e*x+f*y+g*z+h; zNew=i*x+j*y+k*z+l; Maybe something like Sierpinksi pyramid/tetrahedron would be good... I think that would be w a b c d e f g h i j k l p f1 0.5 0.5 0.5 0 0.5 0.5 0.5 0 0.5 0.5 0.5 0 0.25 f2 0.5 0.5 0.5 .5 0.5 0.5 0.5 0 0.5 0.5 0.5 0 0.25 f3 0.5 0.5 0.5 0 0.5 0.5 0.5 .5 0.5 0.5 0.5 0 0.25 f4 0.5 0.5 0.5 0 0.5 0.5 0.5 0 0.5 0.5 0.5 .5 0.25 Note that this won't give you an *equliateral* Sierpinksi pyramid, more a sort of right-angled sierpinksi pyramid. Another simple formula. to make a Menger sponge: w a b c d e f g h i j k l p f1 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.05 f2 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.33 0.33 0.33 0.33 0.05 f3 0.33 0.33 0.33 0 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0 0.05 f4 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.05 f5 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.05 f6 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.05 f7 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.05 f8 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.05 f9 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.05 f10 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.05 f11 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.33 0.05 f12 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.33 0.33 0.33 0.33 0.05 f13 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.33 0.05 f14 0.33 0.33 0.33 0 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0.66 0.05 f15 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0.66 0.05 f16 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0 0.05 f17 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.05 f18 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.05 f19 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.05 f20 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.05 Uh, yeah. I think that's it. I haven't tested it though. Happy fractaling! wow thank you! i'll work on that formulas that you gave me. From where you get those? from your mind?? may you send me the source please? :) and again thank you Title: Re: having troubles with 3D IFS Post by: Timeroot on July 06, 2010, 10:18:08 AM Sure thing. Yeah, I got them from my mind. It's just one transform for each of the 20 smaller cubes the make up the Menger sponge; most of the variables are 0.33 because the cube is 1/3 the size; the other three just move the cube to each of the 20 positions.
Title: Re: having troubles with 3D IFS Post by: yoniHorn on July 06, 2010, 11:55:56 AM Ahh, cool! I didn't read your source code, but I'm guessing you've only implemented affine transformations... From what I know, I guess these follow something like xNew=a*x+b*y+c*z+d; yNew=e*x+f*y+g*z+h; zNew=i*x+j*y+k*z+l; Maybe something like Sierpinksi pyramid/tetrahedron would be good... I think that would be w a b c d e f g h i j k l p f1 0.5 0.5 0.5 0 0.5 0.5 0.5 0 0.5 0.5 0.5 0 0.25 f2 0.5 0.5 0.5 .5 0.5 0.5 0.5 0 0.5 0.5 0.5 0 0.25 f3 0.5 0.5 0.5 0 0.5 0.5 0.5 .5 0.5 0.5 0.5 0 0.25 f4 0.5 0.5 0.5 0 0.5 0.5 0.5 0 0.5 0.5 0.5 .5 0.25 Note that this won't give you an *equliateral* Sierpinksi pyramid, more a sort of right-angled sierpinksi pyramid. Another simple formula. to make a Menger sponge: w a b c d e f g h i j k l p f1 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.05 f2 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.33 0.33 0.33 0.33 0.05 f3 0.33 0.33 0.33 0 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0 0.05 f4 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.05 f5 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.05 f6 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.05 f7 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.33 0.33 0.33 0 0.05 f8 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.05 f9 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.05 f10 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.05 f11 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.33 0.05 f12 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.33 0.33 0.33 0.33 0.05 f13 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.33 0.05 f14 0.33 0.33 0.33 0 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0.66 0.05 f15 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0.66 0.05 f16 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0 0.05 f17 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0 0.33 0.33 0.33 0.66 0.05 f18 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0 0.05 f19 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.05 f20 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.33 0.33 0.33 0.66 0.05 Uh, yeah. I think that's it. I haven't tested it though. Happy fractaling! sorry but I think that the first formulas are not correct.. when i place the point's in the formula they keep going to infinity instead of staying in the same range.. Title: Re: having troubles with 3D IFS Post by: lycium on July 06, 2010, 02:02:25 PM hi yoniHorn,
you can simply initialise a random one :) the iterated transformation T should be contractive on average; so what you do is choose 3 random basis vectors u, v, w with average magnitude <= 1, then you choose a random offset in some range, maybe +/- 4 even. this can be as big as you like, because the overall contractive factor will pull the points towards the origin. Title: Re: having troubles with 3D IFS Post by: yoniHorn on July 06, 2010, 04:23:10 PM hi yoniHorn, alright I think I understand it now..you can simply initialise a random one :) the iterated transformation T should be contractive on average; so what you do is choose 3 random basis vectors u, v, w with average magnitude <= 1, then you choose a random offset in some range, maybe +/- 4 even. this can be as big as you like, because the overall contractive factor will pull the points towards the origin. can you please show me how you build this king of transformation? i got the idea but not how to apply it.. BTW the Sierpinksi pyramid is working Great!! Title: Re: having troubles with 3D IFS Post by: cKleinhuis on July 06, 2010, 04:43:22 PM you form (4d) vectors to fill variables a,b,c,d e,f g,h i, j,k,l xNew=a*x+b*y+c*z+d; yNew=e*x+f*y+g*z+h; zNew=i*x+j*y+k*z+l; just make sure the magnitudes of the vectors are smaller than 1 to achieve a contractive transformation... |