Donate Now Goal amount for this month: 100 USD, Received: 0 USD (0%)
Donate to support this site and ThinBASIC project development

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: 3D Mandelbrot Set

  1. #1

    3D Mandelbrot Set

    can you believe that this picture is a plot of a 3D mandelbrot set !!:





    look at those great images here( very big page with many links):
    http://www.skytopia.com/project/fractal/mandelbulb.html
    i hope i can find some complete algorithm to implement those 3d mandelbrot in thinbasic
    look at the following image from a "3D Fractal Gallery" wich resembles a temple it is in the bottom of other page:
    http://www.skytopia.com/project/fractal/mandelbrot.html




    all in all the site is magnificent, look at the projects tab ; many goodies.
    another ref is an article "Pandora's 3D box" in the great free math magazine :
    http://plus.maths.org/latestnews/sep...ndex.html?nl=1

  2. #2
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Clearwater, Florida, USA
    Posts
    3,802
    Rep Power
    388
    Beautiful stuff Zak, thanks.

  3. #3
    Member sblank's Avatar
    Join Date
    Feb 2010
    Location
    Wayne City, Illinois
    Posts
    80
    Rep Power
    13

    Quaternion Julia Sets

    Hi Zak,

    You might want to look up quaternion Julia sets... those are really beautiful 3D projections of 4D fractals using quaternions (4D analogs of the complex plane).

    I have some C/OpenGL/GLUT code that draws a point cloud quaternion Julia set, including a 3D Mandelbrot set from quaternions. It looks a bit different from the picture you posted, but interesting nonetheless. I would be happy to post the C code here as an attachment if you are interested? The skeleton of the program is similar to the FreeBasic OpenGL/GLUT parametric equation/trackball rotation program I posted in the Wayne City High gaming forum. The difference is in the math and plotting the quaternion point clouds (and the fact that the code is in C...).

    A thinBasic port would be fantastic!

    Cheers,

    Stan

  4. #4
    Hi Stan
    yes of course, if i or other user can convert some C codes to thinbasic this will be fantastic. we will try.
    thanks

  5. #5
    Member sblank's Avatar
    Join Date
    Feb 2010
    Location
    Wayne City, Illinois
    Posts
    80
    Rep Power
    13
    Hi Zak,

    I'm attaching a picture:

    Click image for larger version. 

Name:	quat.jpg 
Views:	938 
Size:	56.3 KB 
ID:	6950

    As well as the FreeBasic program that created the picture. What you see above is a Quaternion Julia Set rendered as a display list. It was created by testing 100 million random points in a 4x4x4 box using quaternions in a fashion similar to the 2D Mandelbrot Set in my Python text. The above image has full trackball rotation using the mouse point (passive mode).

    I translated the program from C to FreeBasic and noticed no degradation in either speed of calculation or in animation. The original C program was created from a skeleton (illiSkel.c) provided by my good friend Prof. George K. Francis (Mathematics) at the U of I. I provided the quaternion math, Mandelbrot, and half-set options in C and the entire translation to FreeBasic.

    The exe file below has 25 million test points... so be patient while the calculations are being done

    Cheers,

    Stan
    Attached Files Attached Files

  6. #6
    Hi Stan
    the 3d graphics is great especially the 3D mandel , thanks for this, it is a pleasure for the eyes, it is good you have enabled choosing julia or mandelbrot (mand = 1 in your freebasic code) i have enjoyed more by the 3d mandel ,have you tried iter=5, incr = 5 the figure is like the temple above. i have downloaded freebasic and tried your examples, and indeed it is a speedy language.
    i have translated your code to thinbasic, but as always there is obstacles. in never exit the calcit function if the loop is approximately more than 30000, so i tried manualy to choose :
    glBegin(%GL_POINTS)
    For foo = 0 To 30000
    instead of
    for foo = 0 to 1000000*incr
    now even after that when going to function doRender() it stop in line:
    glMultMatrixf (VarPtr(aff(1)))
    error: Expected a parameter passed BYREF but found something else.
    aff(1) is the first from array to aff(16).
    so here is my buggy program.
    as a reference to using :
    TBGL_NewList
    ....
    TBGL_EndList
    look at my post about biomorphs there is a usage for lists:
    http://www.thinbasic.com/community/s...ctal-creatures
    again thanks for enabling us to see some freebasic examples.

    PS: be carefull if want to experiment with the more than :
    For foo = 0 To 30000
    and you want to exit by clicking "X", the thinbasic.exe will still swimming in the memory, the only way to end process: by ctrl-alt-del, it is a problem of all ms windows programs
    Attached Files Attached Files
    Last edited by zak; 26-11-2010 at 18:52.

  7. #7
    correction:
    there is an error in Dim foo As integer:
    it must be : Dim foo As Long ,this is why the loop can't go too much.
    but now if the loop is more than 100000 it stay too long.
    add to that the second error as reported above
    attached the second still buggy version with the loop :
    For foo = 0 To 100000
    i want to add that the aliases to GLdouble GLfloat ...etc are at the beginning of the file thinbasic_GL.inc
    Attached Files Attached Files

  8. #8
    this is the last correction i will post, my brain is very loosy, i forgot things easily
    the latest version seems works even too slow:
    correction:
    instead of : glMultMatrixf (VarPtr(aff(1)))
    replace with:
    rr = VarPtr(aff(1))
    glMultMatrixf rr


    doMain() is now within While TBGL_IsWindow
    changed the loop to 1000000
    now it is acceptable but still does not display but a dot not a figure.
    Attached Files Attached Files

  9. #9
    Member sblank's Avatar
    Join Date
    Feb 2010
    Location
    Wayne City, Illinois
    Posts
    80
    Rep Power
    13
    Hi Zak,

    I also saw a single dot running the program. I then commented out the:

    rr = VarPtr(aff(1))
    glMultMatrixf rr

    statements and the next run I saw many dots in a pattern, but did not see anything recognizable and no rotation.

    I think this is progress and its doable... I'm wondering if it would be better to use native TBGL rather than mixing in OpenGL? Just a thought.

    Nice work!

    Stan

  10. #10
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,399
    Rep Power
    649
    Hi Zak,

    you made great progress on the translation. Some parts of original code seem quite redundant, if you look at the Aff array... it is just identity matrix. You get it when you call TBGL_ClearFrame already (this behavior can be disabled via params), so no need to struggle with it.

    I attach code which shows the points, I added percentage counter to console title.


    Petr
    Attached Files Attached Files
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

Page 1 of 2 12 LastLast

Similar Threads

  1. Benoit Mandelbrot, RIP
    By LanceGary in forum Shout Box Area
    Replies: 6
    Last Post: 05-11-2010, 03:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •