Author Topic: Newton Raphson a 3D presentation of the chaotic points  (Read 3522 times)

0 Members and 1 Guest are viewing this topic.

RobbeK

  • Guest
Newton Raphson a 3D presentation of the chaotic points
« on: May 13, 2015, 04:31:27 AM »
Written in PLT Scheme, it's possible to rotate the image.
(complex calculations are done via the FBcomplex lib )


best, Rob

(It starts with an empty screen while doing the initial calculations )



.
« Last Edit: May 13, 2015, 06:48:24 AM by RobbeK »

Charles Pegge

  • Guest
Re: Newton Raphson a 3D presentation of the chaotic points
« Reply #1 on: May 13, 2015, 07:31:57 AM »
Hi Rob,

It is possible to use the fragment-shaders on the graphics card to generate fractals, since all the calculations are performed on each pixel, independent of other pixels.

There are many fragment shaders working in parallel, so it is like using a super-computer :)

GLSL uses C notation with a few extra vector-friendly constructs, and can be compiled dynamically with strings of source code. Would this technology be useful to you?

jack

  • Guest
Re: Newton Raphson a 3D presentation of the chaotic points
« Reply #2 on: May 13, 2015, 07:35:44 AM »
Hi RobbeK
interesting, how were you able to marry FreeBasic and PLT-Scheme ?
btw, you get a good fractal by setting a2, a4, and a6 to 1 and the odd a's to 0

RobbeK

  • Guest
Re: Newton Raphson a 3D presentation of the chaotic points
« Reply #3 on: May 13, 2015, 10:42:38 AM »
Hi,

Yes, Charles -- but I'm still on old gear ( 6 months ago the Cy promised me a new machine for at home )   >:(   
ah, yes , I switched to lines now ,  strangely in OGL a line has no thickness (only a length) - a perpendicular view and the lines vanish  :o


Jack, I just wrote a DLL with the fbcomplex included ,   something as :

------------------------------------------------

#include "fbcomplex.bi"

extern "Windows-MS"

public function Cadd ( x as double , y as double , u as double , v as double ) as complex export
  dim z as complex = cmplx(x,y)+cmplx(u,v)
  return z
end function

...

end extern

on the Scheme side :
-------------------------------------

#lang scheme

(require scheme/foreign)

(unsafe!)

(define dll (ffi-lib "complex.dll"))

(define Cadd
    (get-ffi-obj "Cadd" dll (_fun _double _double _double _double -> (_list-struct _double _double))))

etc ...

the complex is returned as a list containing the real and imag part defined by  (_list-struct _double _double)

you can even input the complex numbers by a lisp structure and keep the ( ...  as complex ,   ... ) in the fb declarations

you get a good fractal by setting a2, a4, and a6 to 1 and the odd a's to 0

 :)  you even can generate kind of Julia fractals with it (attached , executable with the initial values)

thanks , Rob


.
« Last Edit: May 13, 2015, 10:58:35 AM by RobbeK »

Mike Lobanovsky

  • Guest
Re: Newton Raphson a 3D presentation of the chaotic points
« Reply #4 on: May 13, 2015, 11:38:10 AM »
... strangely in OGL a line has no thickness (only a length) - a perpendicular view and the lines vanish  :o ...

This isn't correct, Rob. An OpenGL line also has a width. Most implementations (nVidia, ATi) support glLineWidth(1.0) thru glLineWidth(10.0) where the numbers are single-precision floats.

They aren't however visible from the top or bottom either. But you may end them in OpenGL points whose glPointSize(1.0) thru glPointSize(10.0) can be set to match that of the line. Unlike lines, points are guaranteed to be visible in any projection and at any distance.

RobbeK

  • Guest
Re: Newton Raphson a 3D presentation of the chaotic points
« Reply #5 on: May 13, 2015, 12:18:35 PM »
Ah, thanks Mike,

With thickness , I mean a 3D characteristic (i did not mention width )- can we agree then that they have a length and a possible width (2D) , but no thickness ( the reason they vanish -- otherwise it would be a cylinder of course , but I was hoping it behaved like a point under these viewpoints  )   -- is there any perspective deformation on these lines with a certain width (or is it kept under any conditions ?)

So to keep them visible under any condition I have to make a point and a line connected to it.  (yes , that works)

best, Rob



« Last Edit: May 13, 2015, 12:31:10 PM by RobbeK »

Mike Lobanovsky

  • Guest
Re: Newton Raphson a 3D presentation of the chaotic points
« Reply #6 on: May 14, 2015, 08:47:45 AM »
... is there any perspective deformation on these lines with a certain width (or is it kept under any conditions ?) ...

Hi Rob,

Yes, there is. The declared line width is maintained in the foreground only decreasing slightly towards the line's tail end that's farther away from the viewer on the Z axis. But such perspective correction isn't observed so strictly as e.g. that of a sloped polygon.

The effect looks much better when lines are antialiased. OpenGL points can also be antialiased. And, as a matter of fact, polygons can be antialiased as well.

To impose the AA mode for points, lines and polygons, it is sufficient to call just once the following OpenGL functions somewhere in your app's initialization routine:

glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
glEnable(GL_POINT_SMOOTH)
glEnable(GL_LINE_SMOOTH)
glEnable(GL_POLYGON_SMOOTH)


The alpha-blending mode that's set forth with the first two calls is an indispensable prerequisite for OpenGL to be able to automatically antialias the respective graphics primitives for you. Anywhere further on in your code, you can selectively switch antialiasing off and on again using glDisable(...)/glEnable(...) with the respective parameter as long as OpenGL still runs in the alpha-blending mode, or you can switch antialiasing off and on again altogether using glDisable(GL_BLEND)/glEnable(GL_BLEND).

The cost of anti-aliasing the graphics primitives is practically unnoticeable for modern GPUs and OpenGL drivers.

RobbeK

  • Guest
Re: Newton Raphson a 3D presentation of the chaotic points
« Reply #7 on: May 15, 2015, 01:26:55 PM »
Hi Mike,

Thanks a lot for that info !!  -- very useful (on the web OGL info sometimes is somewhat archaic or even outlandish )


best, Rob