Hi everyone ..
Some time ago I postet a 20 line 2D metaball example if someone remembers. I said I'm working on the 3D realisation.
Now I got it!!
I already had the code on my hdd for months and today I felt ready to complete it.
I hope you like it
Set window title "Metaball Interaktiv"
Set display mode 1024, 768, 32
Sync on : Sync rate 0 : Sync
Backdrop on : Color backdrop 0
#constant GridsizeX 20
#constant GridsizeY 20
#constant GridsizeZ 20
#constant MBO 99
#constant MBMB 99
#constant CColors 10
#constant CDetail Screen width( )
Type TMBall
x As Float
y As Float
z As Float
r As Float
Endtype
rem Variablen
Global dt As Float
lt As Float
ptr As dword
c As dword
ptr = Make memory( 4 + 4*CColors )
*ptr = CColors
For i = 1 To CColors
c = Int( Rnd( 100 )*.01*0xFF )
c = c Or Int( c*0.349 ) << 8
Inc ptr, 4 : *ptr = c
Next
Dim Palette( CDetail ) As Dword
CreateGradient( ptr - 4*CColors )
Lock pixels
For j = 0 To 20
For i = 0 To CDetail
Dot i, j, Palette( i )
Next
Next
Unlock pixels
Get image 1, 2, 2, Screen width() - 3, 20
Make object cube 1, 1000
Texture object 1, 1
Set object cull 1, 0
Set object light 1, 0
Ink 0xFFFFFF, 0xFFFFFF
InitMetaballs()
Set cube mapping on MBO, 1, 1,1,1,1,1
For x = 0 To 255
For y = 0 To 15
Read TLT(x, y)
Next
Next
rem AddMetaballs
AddMetaball(Rnd(GridsizeX), Rnd(GridsizeY), Rnd(GridsizeZ), 1.1)
AddMetaball(Rnd(GridsizeX), Rnd(GridsizeY), Rnd(GridsizeZ), 1.3)
AddMetaball(Rnd(GridsizeX), Rnd(GridsizeY), Rnd(GridsizeZ), 1.5)
AddMetaball(Rnd(GridsizeX), Rnd(GridsizeY), Rnd(GridsizeZ), 1.1)
Do
rem Debug Ausgabe
Set cursor 0, 0
Print "FPS: ", Screen fps()
'Print "Polys: ", Statistic(1)
Print "Rekursionen: ", Rekursions
'Print "dT: ", dt, " ms"
rem Kamerakontrolle
` Position mouse Screen width()/2, Screen height()/2
` Yrotate camera Camera angle y() + Mousemovex()
` Xrotate camera Camera angle x() + Mousemovey()
` If Upkey() Then Move camera 1.5
` If Downkey() Then Move camera -1.5
rem Timer
dt = Timer() - lt
lt = Timer()
rem Positioniere Metaballs
For i = 0 To Array count(MB(0))
o# = timer()*.01 + i*120
r# = 5*Sin( 2 + 8*o#) + i*1.5
MB(i).x = r#*Cos( 3*o# ) + 10
MB(i).y = r#*Cos( 8*o# ) + 7.5
MB(i).z = r#*Sin( 3*o# ) + 10
Next blah
o# = timer()*.001
r# = 40*Sin( 2 + 8*o#)
x# = r#*Cos( 3*o# ) + 10
y# = r#*Cos( 8*o# ) + 7.5
z# = r#*Sin( 3*o# ) + 10
Position camera x#, y#, z#
Point camera 10, 7.5, 10
rem Metaballroutine
Gosub MakeMetaballs
rem Syncronisation
Fastsync
Loop
MakeMetaballs:
Fill memory Get memblock ptr(MBMB), 0, GridsizeX*GridsizeY*GridsizeZ*4
Lock vertexdata for limb MBO, 0, 2
Rekursions = 0
Vertex = 0
For i = 0 To Array count(MB(0))
ComputeArray(Int(MB(i).X), Int(MB(i).Y), Int(MB(i).Z))
Next
Dim TEMPArray(GridsizeX, GridsizeY, GridsizeZ) As Integer
For i = 0 To Array count(MB(0))
TriangulateArray(Int(MB(i).X), Int(MB(i).Y), Int(MB(i).Z))
Next
Undim TEMPArray(0)
For i = Vertex To Get vertexdata vertex count()
Set vertexdata position i, 0, 0, 0
Next
Unlock vertexdata
'calculate object bounds MBO
Return
Function InitMetaballs()
Global Dim TLT(255, 16) As Integer
Global Dim MB(-1) As TMBall
Global Rekursions As Integer
Global Vertex As Integer
Make object sphere MBO, 1, 30, 30 : Make mesh from object MBO, MBO : Make memblock from mesh MBO, MBO : Delete object MBO : Delete mesh MBO
Make mesh from memblock MBO, MBO : Make object MBO, MBO, 0 : Delete memblock MBO
Make memblock MBMB, GridsizeX*GridsizeY*GridsizeZ*4
Endfunction
Function BuildVertex(Index As Integer, x As Float, y As Float, z As Float)
i As integer = 0
V As Float = 0
xn As Float : yn As Float : zn As Float
nx As Float : ny As Float : nz As Float
While TLT(Index, i) > -1
Select TLT(Index, i)
Case 0
xn = x
yn = y + (1 - GetVoxel(x, y, z))/(GetVoxel(x, y + 1, z) - GetVoxel(x, y, z))
zn = z
Endcase
Case 1
xn = x + (1 - GetVoxel(x, y + 1, z))/(GetVoxel(x + 1, y + 1, z) - GetVoxel(x, y + 1, z))
yn = y + 1
zn = z
Endcase
Case 2
xn = x + 1
yn = y + (1 - GetVoxel(x + 1, y, z))/(GetVoxel(x + 1, y + 1, z) - GetVoxel(x + 1, y, z))
zn = z
Endcase
Case 3
xn = x + (1 - GetVoxel(x, y, z))/(GetVoxel(x + 1, y, z) - GetVoxel(x, y, z))
yn = y
zn = z
Endcase
Case 4
xn = x
yn = y + (1 - GetVoxel(x, y, z + 1))/(GetVoxel(x, y + 1, z + 1) - GetVoxel(x, y, z + 1))
zn = z + 1
Endcase
Case 5
xn = x + (1 - GetVoxel(x, y + 1, z + 1))/(GetVoxel(x + 1, y + 1, z + 1) - GetVoxel(x, y + 1, z + 1))
yn = y + 1
zn = z + 1
Endcase
Case 6
xn = x + 1
yn = y + (1 - GetVoxel(x + 1, y, z + 1))/(GetVoxel(x + 1, y + 1, z + 1) - GetVoxel(x + 1, y, z + 1))
zn = z + 1
Endcase
Case 7
xn = x + (1 - GetVoxel(x, y, z + 1))/(GetVoxel(x + 1, y, z + 1) - GetVoxel(x, y, z + 1))
yn = y
zn = z + 1
Endcase
Case 8
xn = x
yn = y
zn = z + (1 - GetVoxel(x, y, z))/(GetVoxel(x, y, z + 1) - GetVoxel(x, y, z))
Endcase
Case 9
xn = x
yn = y + 1
zn = z + (1 - GetVoxel(x, y + 1, z))/(GetVoxel(x, y + 1, z + 1) - GetVoxel(x, y + 1, z))
Endcase
Case 10
xn = x + 1
yn = y + 1
zn = z + (1 - GetVoxel(x + 1, y + 1, z))/(GetVoxel(x + 1, y + 1, z + 1) - GetVoxel(x + 1, y + 1, z))
Endcase
Case 11
xn = x + 1
yn = y
zn = z + (1 - GetVoxel(x + 1, y, z))/(GetVoxel(x + 1, y, z + 1) - GetVoxel(x + 1, y, z))
Endcase
Endselect
Set vertexdata position Vertex, xn, yn, zn
Rem Normalisation
rem Berechne Normale für Vertex 0 -> damit gleichzeitig für alle
nx = 0 : ny = 0 : nz = 0
For j = 0 To Array count(MB(0))
V = 1/((xn- MB(j).x)^2 + (yn - MB(j).y)^2 + (zn - MB(j).z)^2)^2
Dec nx, V*2*(MB(j).x - xn)
Dec ny, V*2*(MB(j).y - yn)
Dec nz, V*2*(MB(j).z - zn)
Next
V = Sqrt(nx^2 + ny^2 + nz^2)
nx = nx/V
ny = ny/V
nz = nz/V
Set vertexdata normals Vertex, nx, ny, nz
Inc Vertex
Inc i
Endwhile
Endfunction
Function ComputeArray(x As Float, y As Float, z As Float)
i As Integer
If x > GridsizeX - 1 Or x < 0 Or y > GridsizeY - 1 Or y < 0 Or z > GridsizeZ - 1 Or z < 0 Then Exitfunction
If GetVoxel(x, y, z) = 0
For i = 0 To Array count(MB(0))
SetVoxel(x, y, z, GetVoxel(x, y, z) + Metaball(x, y, z, MB(i).x, MB(i).y, MB(i).z, MB(i).r))
Next
Else
Exitfunction
Endif
If GetVoxel(x, y, z) < 1.0
Exitfunction
Else
ComputeArray(x, y, z + 1)
ComputeArray(x, y, z - 1)
ComputeArray(x, y + 1, z)
ComputeArray(x, y - 1, z)
ComputeArray(x + 1, y, z)
ComputeArray(x - 1, y, z)
Endif
Inc Rekursions
Endfunction
Function TriangulateArray(x As Integer, y As Integer, z As Integer)
i As Integer
If x > GridsizeX - 2 Or x < 0 Or y > GridsizeY - 2 Or y < 0 Or z > GridsizeZ - 2 Or z < 0 Then Exitfunction
If TEMPArray(x, y, z) = 0xFF00FF Then Exitfunction
If GetVoxel(x, y, z) > 1 Then Inc Index, 1
If GetVoxel(x, y + 1, z) > 1 Then Inc Index, 2
If GetVoxel(x + 1, y + 1, z) > 1 Then Inc Index, 4
If GetVoxel(x + 1, y, z) > 1 Then Inc Index, 8
If GetVoxel(x, y, z + 1) > 1 Then Inc Index, 16
If GetVoxel(x, y + 1, z + 1) > 1 Then Inc Index, 32
If GetVoxel(x + 1, y + 1, z + 1) > 1 Then Inc Index, 64
If GetVoxel(x + 1, y, z + 1) > 1 Then Inc Index, 128
If Index > 0
BuildVertex(Index, x, y, z)
Endif
TEMPArray(x, y, z) = 0xFF00FF
TriangulateArray(x, y, z + 1)
TriangulateArray(x, y, z - 1)
TriangulateArray(x, y + 1, z)
TriangulateArray(x, y - 1, z)
TriangulateArray(x + 1, y, z)
TriangulateArray(x - 1, y, z)
Endfunction
Function AddMetaball(x As Float, y As Float, z As Float, r As Float)
Array index to queue MB(0)
Add to queue MB(0)
MB().x = x
MB().y = y
MB().z = z
MB().r = r
Endfunction
Function Metaball(x As Float, y As Float, z As Float, a As Float, b As Float, c As Float, r As Float)
V As Float
h# = (x - a)
i# = (y - b)
j# = (z - c)
V = Sqrt((r*r)/(h#*h# + i#*i# + j#*j# + 0.00001))
Endfunction V
Function SumMetaballs(x As Float, y As Float, z As Float)
V As Float
For i = 0 To Array count(MB(0))
Inc V, MB(i).r^2/((x - MB(i).x)^2 + (y - MB(i).y)^2 + (z - MB(i).z)^2)
Next
Endfunction V
Function SetVoxel(x As Integer, y As Integer, z As Integer, V As Float)
Write memblock float MBMB, (x*GridsizeY*GridsizeZ + y*GridsizeZ + z)*4, V
Endfunction
Function GetVoxel(x As Integer, y As Integer, z As Integer)
V As Float
V = Memblock float(MBMB, (x*GridsizeY*GridsizeZ + y*GridsizeZ + z)*4)
Endfunction V
Function CreateGradient( ptr As dword )
dr As float
dg As float
db As float
Cr As float
Cg As float
Cb As float
pcr As float
pcg As float
pcb As float
i As integer
j As integer = 0
Colors As Integer
Colors = *ptr
Inc ptr, 4
For i = 1 To Colors - 1
Cr = Rgbr( *ptr )
Cg = Rgbg( *ptr )
Cb = Rgbb( *ptr )
Inc ptr, 4
dr = Rgbr( *ptr ) - Cr
dg = Rgbg( *ptr ) - Cg
db = Rgbb( *ptr ) - Cb
pcr = dr/CDetail*(Colors - 1)
pcg = dg/CDetail*(Colors - 1)
pcb = db/CDetail*(Colors - 1)
Repeat
Inc j
Inc Cr, pcr
Inc Cg, pcg
Inc Cb, pcb
Palette( j ) = Rgb( Int( Cr ), Int( Cg ), Int( Cb ))
Until j >= CDetail/(Colors - 1)*i
Next
Endfunction
`{Sub_TLTData:
Sub_TLTData:
Data -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1
Data 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1
Data 3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1
Data 3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1
Data 9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1
Data 1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1
Data 9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1
Data 2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1
Data 8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1
Data 9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1
Data 4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1
Data 3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1
Data 1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1
Data 4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1
Data 4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1
Data 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1
Data 1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1
Data 5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1
Data 2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1
Data 9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1
Data 0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1
Data 2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1
Data 10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1
Data 4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1
Data 5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1
Data 5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1
Data 9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1
Data 0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1
Data 1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1
Data 10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1
Data 8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1
Data 2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1
Data 7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1
Data 9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1
Data 2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1
Data 11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1
Data 9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1
Data 5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1
Data 11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1
Data 11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1
Data 1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1
Data 9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1
Data 5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1
Data 2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1
Data 0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1
Data 5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1
Data 6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1
Data 0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1
Data 3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1
Data 6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1
Data 5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1
Data 1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1
Data 10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1
Data 6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1
Data 1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1
Data 8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1
Data 7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1
Data 3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1
Data 5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1
Data 0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1
Data 9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1
Data 8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1
Data 5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1
Data 0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1
Data 6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1
Data 10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1
Data 10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1
Data 8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1
Data 1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1
Data 3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1
Data 0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1
Data 10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1
Data 0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1
Data 3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1
Data 6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1
Data 9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1
Data 8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1
Data 3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1
Data 6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1
Data 0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1
Data 10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1
Data 10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1
Data 1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1
Data 2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1
Data 7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1
Data 7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1
Data 2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1
Data 1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1
Data 11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1
Data 8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1
Data 0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1
Data 7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1
Data 10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1
Data 2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1
Data 6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1
Data 7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1
Data 2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1
Data 1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1
Data 10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1
Data 10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1
Data 0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1
Data 7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1
Data 6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1
Data 8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1
Data 9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1
Data 6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1
Data 1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1
Data 4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1
Data 10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1
Data 8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1
Data 0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1
Data 1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1
Data 8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1
Data 10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1
Data 4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1
Data 10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1
Data 5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1
Data 11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1
Data 9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1
Data 6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1
Data 7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1
Data 3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1
Data 7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1
Data 9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1
Data 3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1
Data 6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1
Data 9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1
Data 1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1
Data 4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1
Data 7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1
Data 6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1
Data 3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1
Data 0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1
Data 6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1
Data 1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1
Data 0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1
Data 11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1
Data 6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1
Data 5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1
Data 9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1
Data 1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1
Data 1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1
Data 10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1
Data 0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1
Data 5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1
Data 10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1
Data 11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1
Data 0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1
Data 9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1
Data 7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1
Data 2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1
Data 8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1
Data 9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1
Data 9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1
Data 1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1
Data 9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1
Data 9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1
Data 5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1
Data 0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1
Data 10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1
Data 2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1
Data 0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1
Data 0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1
Data 9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1
Data 5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1
Data 3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1
Data 5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1
Data 8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1
Data 0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1
Data 9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1
Data 0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1
Data 1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1
Data 3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1
Data 4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1
Data 9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1
Data 11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1
Data 11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1
Data 2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1
Data 9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1
Data 3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1
Data 1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1
Data 4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1
Data 4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1
Data 0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1
Data 3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1
Data 3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1
Data 0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1
Data 9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1
Data 1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data 0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Data -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
A screenshot here:
I wasn't sure to compress this to 20 lines..
Compiled this with U5.6 If there are any problems tell me.
Hope you also get more than 30fps