Beautiful stuff Zak, thanks.
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
Beautiful stuff Zak, thanks.
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
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
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
Hi Zak,
I'm attaching a picture:
quat.jpg
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
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
Last edited by zak; 26-11-2010 at 18:52.
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
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.
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
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
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Bookmarks