Author Topic: How to address tB dynamic arrays in O2  (Read 2192 times)

0 Members and 1 Guest are viewing this topic.

RobbeK

  • Guest
How to address tB dynamic arrays in O2
« on: October 08, 2014, 10:37:42 AM »
HI all, Charles,

dim cox at #cox as double           --- how do you make this work when cox is dynamic in tB and redim'ed every new image ?
dim lngth at #nr_coor as long
dim i as long
 

  Sub finish() link #pFinish
  terminate
  End Sub   

 
 

sub centerX() link #cX   
 Dim As double mini , maxi , center
 mini=100000
 maxi=-100000  ...................................


IMHO found something interesting, the Fresnel fractals extended into 3D -- these are based on trancendent numbers like pi , e , fi (the golden ratio) , sqrt (2) etc ....
in the example Formula I does the XY , and Formula II the Z value (if both is the same, try pi and pi the image is flat).

best, Rob   (use the arrow keys , PgUp PgDn to navigate)

.

Charles Pegge

  • Guest
Re: How to address tB dynamic arrays in O2
« Reply #1 on: October 08, 2014, 11:57:13 AM »
Hi Rob I suggest making thinBasic pass the Varptr(..) of your dynamic array base element when calling the Oxygen function. Oxygen can then overlay its own array using this value:

function foo(sys pt) link #pfoo
indexbase 0 'or 1?
dim double cox at pt
...

RobbeK

  • Guest
Re: How to address tB dynamic arrays in O2
« Reply #2 on: October 09, 2014, 12:32:49 PM »
Thanks Charles !

Mike Lobanovsky

  • Guest
Re: How to address tB dynamic arrays in O2
« Reply #3 on: October 09, 2014, 05:12:03 PM »
Hi Rob,

Looks very nice indeed.

Since this app is 3D, I think it misses badly some controls that would allow object zoom for us to be able to examine its output more closely.

Also, downloading and running unarchived executables from the net annoys Vista+ installations badly.

P.S. Here's a snapshot of your app running under Windows 10. It's the very first snapshot taken so far. :)

.

RobbeK

  • Guest
Re: How to address tB dynamic arrays in O2
« Reply #4 on: October 10, 2014, 12:13:19 AM »
Hi Mike,

Don't  the arrow keys and PgUp / Dn work ???
Attached a square root , making some "serpentines" -- think that's a perfect Russian word too  :)  (more or less)


best Rob
you can use fi , pi , e , pi2   any sqrt(x) , sin(x) , tan(x)  etc ...  where x is any number (the trig functions may generate a rational number however ...  )

addendum :  converted / completed with O² now -  it's "blitzing" now  8)

the math core is very simple :

sub theta()
  n=mod(n+pi2*vala,pi2)
end sub

sub thetaz()
  nz=mod(nz+pi2*valb,pi2)
end sub 
 
 
 
Sub phi ()
   m = Mod(n+m,pi2)
   mz= Mod(nz+mz,pi2)
   x=x+Cos(m)
   y=y+Sin(m)
   z=z+(Sin(mz)/4)
End Sub

sub comp()
x=0 : y=0 : z=0 : n=0
m=0 : nz = 0 : mz=0
For i=0 To nr_coor  - 1
     theta()
     thetaz()
     phi()
     cox(i)=x : coy(i)=y : coz(i)=z
Next
end sub

that's all  (beware - the arrays are still static - max iteration level = 500.000 )  -- as your comp probably has a lot more how do you call it ?  VRAM ?  (irrc mine has only 64 Mb) -- you can try 490.000 or so --  resulting in a more complete picture
.. ah, yes , if you want them flat , 2D , add a rational number in Formula II    or 0 ....


.
« Last Edit: October 10, 2014, 02:06:39 AM by RobbeK »

Mike Lobanovsky

  • Guest
Re: How to address tB dynamic arrays in O2
« Reply #5 on: October 10, 2014, 03:50:09 AM »
Hi Rob,

The "serpentines" look awesome indeed, thanks! :)

Yes, PgUp/PgDn do  rotate and zoom the "serpentines" but they only rotated your previous fractal without any zoom.

<theatrical whisper>
Rob, it is bad manners under Windows to upload unarchived .EXE and .CHM files. They set off annoying system alarms when downloaded and launched for execution. Such behavior is part of MS Windows antivirus system policy. You are scaring off your users. Please zip or 7-zip all your samples before uploading them to the site. Thank you!
</theatrical whisper>

.
« Last Edit: October 10, 2014, 04:13:08 AM by Mike Lobanovsky »