wbolden / complex

WebGL Complex Function Plotter, also includes support for dual and split-complex numbers
https://wbolden.github.io/complex/
23 stars 5 forks source link

Trying to understand the 3d logic... #1

Open scruffynerf opened 4 years ago

scruffynerf commented 4 years ago

I've got a beautiful 3d mandelbrot with amazing curves (spin?), and I'm not sure I've EVER seen this particular 3d representation, it's so elegant and makes so much sense..., and I'm trying to understand where the spinning of the 'leaves' is coming from...

f(z) = {z'z'+z, 0, 5000} view in 3d

I'd love to plot this in higher resolution... to see the 'veins' develop and connect to the smaller brot at the tip, etc...

wbolden commented 4 years ago

Sorry I didn't notice this earlier. In this tool when viewing a function in 3D the height (z axis) of each point is determined by the imaginary component of f(z). If you got the height from the real component of f(z) you would get a similar effect. The reason this probably looks different from most Mandelbrot representations is that most people color by the amount of iterations required before a point diverges towards infinity rather than any function of f(z) itself.

If you were asking about the mathematics of why the bulbs alternate as you've observed, I unfortunately don't have time to dig into that right now. Though if you're interested, someone on MathOverflow would probably be able to help.

scruffynerf commented 4 years ago

Actually that answer helped. If the height is the imaginary portion of f(z), it likely alternates between leaves/bulbs between positive and negative values, which makes total sense.

I really wish we could have higher resolution on this. I haven't found a better grapher yet for this

wbolden commented 4 years ago

I don't have time to implement a nice way to scale the resolution right now, though you should be able to kind of hack it by zooming out in google chrome (Ctrl+-). This works because the resolution I render the scene at is just based on window.innerWidth and window.innerHeight, which changes when you zoom in or out in chrome (and maybe other browsers too, I haven't checked).

In principle you could also just directly paste the onresize event code into your browsers command console with custom width/height, e.g.: canvas.width = YourWidthHere; canvas.height = YourHeightHere; scale = [canvas.width/basewidth, canvas.height/baseheight]; clearTimeout(timeout); timeout = setTimeout(function(){com_tfb = makeTextureFramebuffer(canvas.width, canvas.height); com_tfb_float = makeTextureFramebuffer(canvas.width, canvas.height,gl.FLOAT); var wh = canvas.width/canvas.height; var hh = 1.0; view3D = new Matrix4().setOrtho(-wh, wh, -hh, hh, 10000, -10000); if(!render2D) { cleanup3D(); setup3D(); } redrawScene();}, 100);

Either way, it's probable things will be glitchy.