Logo by bib - 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: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. March 29, 2024, 08:11:49 AM


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: HTML 5 Mandelbrot / Julia Zoomer  (Read 3398 times)
0 Members and 1 Guest are viewing this topic.
asimes
Fractal Lover
**
Posts: 212



asimes
WWW
« on: May 23, 2012, 10:19:26 AM »

There was a post recently on a Mandelbrot zoomer ( http://www.fractalforums.com/fractal-related-links/fractal-web-app-t11951/msg47219/ ) that I really liked and I decided to make my own (EDIT: This link does not exist anymore. I rewrote it and a new version is here: http://alexsimes.com/index.php?foo=visual%20programming&bar=mandelbrot%20set).

The goal was to make something intuitive enough for non-fractal-experts to use. Suggestions or feedback is greatly appreciated.

Note: This probably will not work in IE 8 or older (HTML 5). I am still testing out bugs in different browsers, if you notice any please let me know.
« Last Edit: August 18, 2013, 06:13:18 AM by asimes » Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #1 on: May 23, 2012, 10:27:29 AM »

sloow wink default 50 iterations is enough
would like to have double click zoom ...
and drag n drop wink
well done!
Logged

---

divide and conquer - iterate and rule - chaos is No random!
taurus
Fractal Supremo
*****
Posts: 1175



profile.php?id=1339106810 @taurus_arts_66
WWW
« Reply #2 on: May 23, 2012, 02:18:33 PM »

cool thingy. works fine on firefox and pretty fast - even with full window @ 1920x1200

on ie9 it's almost unusable. takes about half a minute to show up in same resolution, and crashes the tab sometimes. (who wonders?)

the interface is really simple and intuitive. doubleclick zoom would be nice, but i'm not sure, if there is such a browser event... (edit: there is - dblclick - rarely used and difficult to separate from click)
picking julia constants from crosshair would also be nice  wink

well done, asimes!  A Beer Cup
« Last Edit: May 23, 2012, 03:40:47 PM by taurus66 » Logged

when life offers you a lemon, get yourself some salt and tequila!
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #3 on: May 23, 2012, 05:30:55 PM »

On Chrome it's blazing fast! Yesss cheesy
Logged

No sweat, guardian of wisdom!
asimes
Fractal Lover
**
Posts: 212



asimes
WWW
« Reply #4 on: May 23, 2012, 06:07:20 PM »

Thanks all smiley

cKleinhuis, what browser did you use? I have a mac so I checked Safari, Chrome, Firefox, and Opera but not IE. It seemed fairly quick (assuming there are not too many pixels that hit the max iterations)

I think double clicking would be much faster for zooming but I'm afraid of people getting confused when they do it on accident and then the browser starts rendering the new image. Right now I have it set up so that the zoomed in / out fractal is centered to where the cross hair was.

I like the Julia Constants from cross hair idea, I'll see about adding it.
Logged
asimes
Fractal Lover
**
Posts: 212



asimes
WWW
« Reply #5 on: May 24, 2012, 09:24:13 PM »

One thing that really annoys me about me code is that I am testing if "Mandelbrot" or "Julia" mode is selected and running ALMOST identical code based on that. The only real difference is that:
Code:
zr = zrr-zii+x;
zi = twozri+y;

becomes:
Code:
zr = zrr-zii+jx;
zi = twozri+jy;

inside of this loop:
Code:
var x = xMin-pSize/2+xMargin;
for (var i = 0; i < msWidth; i++) {
var y = yMin-pSize/2+yMargin;
for (var j = 0; j < msHeight; j++) {
var zr = x;
var zi = y;
var n = 0;
while (n < maxIterations) {
var zrr = zr*zr;
var zii = zi*zi;
var twozri = 2.0*zr*zi;
zr = zrr-zii+x;
zi = twozri+y;
if (zrr+zii > 16) break;
n++;
}
var index = (i+j*msWidth)*4;
if (n == maxIterations) {
msImageData.data[index] = 255;
msImageData.data[index+1] = 255;
msImageData.data[index+2] = 255;
msImageData.data[index+3] = 255;
}
else {
var fn = n+1-Math.log(Math.log(Math.sqrt(zr*zr+zi*zi)))/Math.log(2);
var logColor = Math.max(Math.log(fn)/Math.log(maxIterations)*255, 0);
msImageData.data[index] = logColor;
msImageData.data[index+1] = logColor;
msImageData.data[index+2] = logColor;
msImageData.data[index+3] = 255;
}
y += dInc;
}
x += dInc;
}

There must be some clever way to change those two lines without performing a test inside of the while loop (that slows everything down A LOT). Any ideas?
Logged
makc
Strange Attractor
***
Posts: 272



« Reply #6 on: March 05, 2013, 12:42:03 AM »

obviously you could put zi = twozri+y*a+jy*b; where a,b are 0,1 or 1,0 but not sure this would be any faster than "if"
Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #7 on: March 05, 2013, 08:51:23 AM »

i used gts250 nvidia gpu, might be that it is rather slow after all sad
Logged

---

divide and conquer - iterate and rule - chaos is No random!
Apophyster
Conqueror
*******
Posts: 124


« Reply #8 on: March 05, 2013, 09:26:57 AM »

confirm In Delphi it is arctan2(y,x) .
Logged

Rice, wheat and corn make the world go round.
Love and money are just passengers.
Friendliness is the destination.
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Julia Set that looks like a Mandelbrot Set Mandelbrot & Julia Set bugman 3 4402 Last post November 06, 2009, 08:37:36 PM
by David Makin
Real time Mandelbrot zoomer to 1e-6 in flash! Programming makc 13 6546 Last post April 14, 2010, 01:41:28 AM
by makc
Mandelbrot Maps: An open-source Mandelbrot/Julia explorer for Android Smartphones / Mobile Devices withad 0 9538 Last post March 20, 2012, 07:35:07 PM
by withad
Fractal Zoomer 1.0.4.3 Fractal Programs « 1 2 » superheal 17 12769 Last post December 05, 2017, 09:17:32 PM
by Gerson
Mandelbrot zoomer with ability to save images & parameters General Discussion KReeser 4 4774 Last post April 01, 2017, 10:50:12 PM
by superheal

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.152 seconds with 24 queries. (Pretty URLs adds 0.006s, 2q)