Here is a skybox object I use in my
20liner project
Having a single square texture for the skybox may gain performance on older graphics cards...
The 6 skybox sides are divided into 4 part each and reassembled into a 5*5 parts grid
A border is also drawn around each part
To calculate the side texture size:
for example with a final texture of 1024 size
(not necessary pow of 2 but there a annoying bug in Save Image function)
Int 1024/5 = 204
204 - 2 = 202 (Border)
202*2 = 404*404 Side texture size!
Set Display Mode 800, 600, 32
Set Window Off
Hide Mouse
Rem Do not forget this!
BackDrop Off
CameraRange# = 2048.0
Set Camera Range 0.25, 0.25 + CameraRange#
Rem SkyBoxScale# = length from the center of the cube to its vertices
SkyBoxScale# = (CameraRange# * 100.0) / Sqrt(3.0)
CreateSkyboxObject(1, 1024)
rem Save Object "SkyBox.dbo", 1
Load Image "FreeSampleFromSkyMatter.png", 1
rem Load Object "SkyBox.dbo", 1
Set Object Light 1, 0
Texture Object 1, 1
Scale Object 1, SkyBoxScale#, SkyBoxScale#, SkyBoxScale#
Sync On
Sync Rate 0
Do
Rotate Camera 90.0-(MouseY()*180.0)/600.0, -(MouseX()*360.0)/400.0, 0.0
Position Object 1, Camera Position X(0), Camera Position Y(0), Camera Position Z(0)
Text 0, 0, Str$(Screen FPS())
Sync
Loop
End
`_____________________________________________________________________________________________________
Function CreateSkyboxObject(Object, TextureSize)
TS = TextureSize
Begin New Object
Add New Limb 4*24, 6*24
Finish New Object Object
Vi = 0: Ii = 0
Make Mesh From Object 1, Object
Delete Object Object
Lock VertexData For Mesh 1
_SkyboxVertexDataQuadX(Vi, Ii, -1.0, -1.0, 1.0, 0.0, 0.0, 0, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadX(Vi, Ii, -1.0, 0.0, 1.0, 1.0, 0.0, 1, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadX(Vi, Ii, -1.0, 0.0, 0.0, 1.0, -1.0, 3, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadX(Vi, Ii, -1.0, -1.0, 0.0, 0.0, -1.0, 2, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadX(Vi, Ii, 1.0, 1.0, 1.0, 0.0, 0.0, 4, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadX(Vi, Ii, 1.0, 0.0, 1.0, -1.0, 0.0, 5, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadX(Vi, Ii, 1.0, 0.0, 0.0, -1.0, -1.0, 7, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadX(Vi, Ii, 1.0, 1.0, 0.0, 0.0, -1.0, 6, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadY(Vi, Ii, -1.0, -1.0, 1.0, 0.0, 0.0, 8, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadY(Vi, Ii, -1.0, 0.0, 1.0, 1.0, 0.0, 9, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadY(Vi, Ii, -1.0, 0.0, 0.0, 1.0, -1.0, 11, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadY(Vi, Ii, -1.0, -1.0, 0.0, 0.0, -1.0, 10, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadY(Vi, Ii, 1.0, -1.0, -1.0, 0.0, 0.0, 12, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadY(Vi, Ii, 1.0, 0.0, -1.0, 1.0, 0.0, 13, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadY(Vi, Ii, 1.0, 0.0, 0.0, 1.0, 1.0, 15, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadY(Vi, Ii, 1.0, -1.0, 0.0, 0.0, 1.0, 14, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadZ(Vi, Ii, -1.0, 1.0, 1.0, 0.0, 0.0, 16, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadZ(Vi, Ii, -1.0, 0.0, 1.0, -1.0, 0.0, 17, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadZ(Vi, Ii, -1.0, 0.0, 0.0, -1.0, -1.0, 19, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadZ(Vi, Ii, -1.0, 1.0, 0.0, 0.0, -1.0, 18, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadZ(Vi, Ii, 1.0, -1.0, 1.0, 0.0, 0.0, 20, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadZ(Vi, Ii, 1.0, 0.0, 1.0, 1.0, 0.0, 21, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadZ(Vi, Ii, 1.0, 0.0, 0.0, 1.0, -1.0, 23, TS): Inc Vi, 4: Inc Ii, 6
_SkyboxVertexDataQuadZ(Vi, Ii, 1.0, -1.0, 0.0, 0.0, -1.0, 22, TS): Inc Vi, 4: Inc Ii, 6
Unlock VertexData
Make Object Object, 1
Delete Mesh 1
EndFunction
`_____________________________________________________________________________________________________
Function _SkyboxVertexDataQuadX(Vertex, Index, X#, LZ#, TY#, RZ#, BY#, Part, TexSize)
Size = TexSize / 5: Size = Size * 5
Row = Part / 5: Col = Part Mod 5
LU# = (((Col*Size)/5 + 1)*1.0) / (TexSize*1.0)
RU# = ((((Col+1)*Size)/5 - 1)*1.0) / (TexSize*1.0)
TV# = (((Row*Size)/5 + 1)*1.0) / (TexSize*1.0)
BV# = ((((Row+1)*Size)/5 - 1)*1.0) / (TexSize*1.0)
Set IndexData Index, Vertex: Inc Index
Set IndexData Index, Vertex+1: Inc Index
Set IndexData Index, Vertex+2: Inc Index
Set IndexData Index, Vertex: Inc Index
Set IndexData Index, Vertex+2: Inc Index
Set IndexData Index, Vertex+3
Set VertexData Position Vertex, X#, TY#, LZ#: Set VertexData UV Vertex, LU#, TV#: Inc Vertex
Set VertexData Position Vertex, X#, TY#, RZ#: Set VertexData UV Vertex, RU#, TV#: Inc Vertex
Set VertexData Position Vertex, X#, BY#, RZ#: Set VertexData UV Vertex, RU#, BV#: Inc Vertex
Set VertexData Position Vertex, X#, BY#, LZ#: Set VertexData UV Vertex, LU#, BV#: Inc Vertex
EndFunction
`_____________________________________________________________________________________________________
Function _SkyboxVertexDataQuadY(Vertex, Index, Y#, LX#, TZ#, RX#, BZ#, Part, TexSize)
Size = TexSize / 5: Size = Size * 5
Row = Part / 5: Col = Part Mod 5
LU# = (((Col*Size)/5 + 1)*1.0) / (TexSize*1.0)
RU# = ((((Col+1)*Size)/5 - 1)*1.0) / (TexSize*1.0)
TV# = (((Row*Size)/5 + 1)*1.0) / (TexSize*1.0)
BV# = ((((Row+1)*Size)/5 - 1)*1.0) / (TexSize*1.0)
Set IndexData Index, Vertex: Inc Index
Set IndexData Index, Vertex+1: Inc Index
Set IndexData Index, Vertex+2: Inc Index
Set IndexData Index, Vertex: Inc Index
Set IndexData Index, Vertex+2: Inc Index
Set IndexData Index, Vertex+3
Set VertexData Position Vertex, LX#, Y#, TZ#: Set VertexData UV Vertex, LU#, TV#: Inc Vertex
Set VertexData Position Vertex, RX#, Y#, TZ#: Set VertexData UV Vertex, RU#, TV#: Inc Vertex
Set VertexData Position Vertex, RX#, Y#, BZ#: Set VertexData UV Vertex, RU#, BV#: Inc Vertex
Set VertexData Position Vertex, LX#, Y#, BZ#: Set VertexData UV Vertex, LU#, BV#: Inc Vertex
EndFunction
`_____________________________________________________________________________________________________
Function _SkyboxVertexDataQuadZ(Vertex, Index, Z#, LX#, TY#, RX#, BY#, Part, TexSize)
Size = TexSize / 5: Size = Size * 5
Row = Part / 5: Col = Part Mod 5
LU# = (((Col*Size)/5 + 1)*1.0) / (TexSize*1.0)
RU# = ((((Col+1)*Size)/5 - 1)*1.0) / (TexSize*1.0)
TV# = (((Row*Size)/5 + 1)*1.0) / (TexSize*1.0)
BV# = ((((Row+1)*Size)/5 - 1)*1.0) / (TexSize*1.0)
Set IndexData Index, Vertex: Inc Index
Set IndexData Index, Vertex+1: Inc Index
Set IndexData Index, Vertex+2: Inc Index
Set IndexData Index, Vertex: Inc Index
Set IndexData Index, Vertex+2: Inc Index
Set IndexData Index, Vertex+3
Set VertexData Position Vertex, LX#, TY#, Z#: Set VertexData UV Vertex, LU#, TV#: Inc Vertex
Set VertexData Position Vertex, RX#, TY#, Z#: Set VertexData UV Vertex, RU#, TV#: Inc Vertex
Set VertexData Position Vertex, RX#, BY#, Z#: Set VertexData UV Vertex, RU#, BV#: Inc Vertex
Set VertexData Position Vertex, LX#, BY#, Z#: Set VertexData UV Vertex, LU#, BV#: Inc Vertex
EndFunction
And the texture Generator:
Dim PC_BL(4)
Dim PC_IL(4)
Dim PC_IR(4)
Dim PC_BR(4)
Load Bitmap "neg_x.bmp", 1
Load Bitmap "pos_x.bmp", 2
Load Bitmap "neg_y.bmp", 3
Load Bitmap "pos_y.bmp", 4
Load Bitmap "neg_z.bmp", 5
Load Bitmap "pos_z.bmp", 6
CreateSkyboxGridBitmap(9, 1024, 1, 2, 3, 4, 5, 6)
Get Image 1, 0, 0, 1024, 1024
Save Image "SkyBox.bmp", 1
Copy Bitmap 9, 0
Print "File saved"
Do
Loop
`_____________________________________________________________________________________________________
Function _DrawBorder(SrcX, SrcY, IncSrcX, IncSrcY, DestX, DestY, IncDestX, IncDestY, Lenght)
For i = 1 To Lenght
Dot DestX, DestY, Point(SrcX, SrcY)
SrcX = SrcX + IncSrcX
SrcY = SrcY + IncSrcY
DestX = DestX + IncDestX
DestY = DestY + IncDestY
Next i
EndFunction
`_____________________________________________________________________________________________________
Function _DrawBorders(DestPart, LeftPart, RightPart, TopPart, BottomPart, RotateLeftPart, RotateRightPart, RotateTopPart, RotateBottomPart, TLClr, TRClr, BRClr, BLClr, Length)
DRow = DestPart/5: DCol = DestPart Mod 5
SRow = LeftPart/5: SCol = LeftPart Mod 5
If RotateLeftPart = 0 Then SrcX = PC_IR(SCol): SrcY = PC_IL(SRow): IncSrcX = 0: IncSrcY = 1
If RotateLeftPart = 1 Then SrcX = PC_IL(SCol): SrcY = PC_IL(SRow): IncSrcX = 1: IncSrcY = 0
If RotateLeftPart =-1 Then SrcX = PC_IR(SCol): SrcY = PC_IR(SRow): IncSrcX =-1: IncSrcY = 0
_DrawBorder(SrcX, SrcY, IncSrcX, IncSrcY, PC_BL(DCol), PC_IL(DRow), 0, 1, Length)
SRow = RightPart/5: SCol = RightPart Mod 5
If RotateRightPart = 0 Then SrcX = PC_IL(SCol): SrcY = PC_IL(SRow): IncSrcX = 0: IncSrcY = 1
If RotateRightPart = 1 Then SrcX = PC_IL(SCol): SrcY = PC_IR(SRow): IncSrcX = 1: IncSrcY = 0
If RotateRightPart =-1 Then SrcX = PC_IR(SCol): SrcY = PC_IL(SRow): IncSrcX =-1: IncSrcY = 0
_DrawBorder(SrcX, SrcY, IncSrcX, IncSrcY, PC_BR(DCol), PC_IL(DRow), 0, 1, Length)
SRow = TopPart/5: SCol = TopPart Mod 5
If RotateTopPart = 0 Then SrcX = PC_IL(SCol): SrcY = PC_IR(SRow): IncSrcX = 1: IncSrcY = 0
If RotateTopPart =-1 Then SrcX = PC_IL(SCol): SrcY = PC_IL(SRow): IncSrcX = 0: IncSrcY = 1
If RotateTopPart = 1 Then SrcX = PC_IR(SCol): SrcY = PC_IR(SRow): IncSrcX = 0: IncSrcY =-1
If RotateTopPart = 2 Then SrcX = PC_IR(SCol): SrcY = PC_IL(SRow): IncSrcX =-1: IncSrcY = 0
_DrawBorder(SrcX, SrcY, IncSrcX, IncSrcY, PC_IL(DCol), PC_BL(DRow), 1, 0, Length)
SRow = BottomPart/5: SCol = BottomPart Mod 5
If RotateBottomPart = 0 Then SrcX = PC_IL(SCol): SrcY = PC_IL(SRow): IncSrcX = 1: IncSrcY = 0
If RotateBottomPart =-1 Then SrcX = PC_IR(SCol): SrcY = PC_IL(SRow): IncSrcX = 0: IncSrcY = 1
If RotateBottomPart = 1 Then SrcX = PC_IL(SCol): SrcY = PC_IR(SRow): IncSrcX = 0: IncSrcY =-1
If RotateBottomPart = 2 Then SrcX = PC_IR(SCol): SrcY = PC_IR(SRow): IncSrcX =-1: IncSrcY = 0
_DrawBorder(SrcX, SrcY, IncSrcX, IncSrcY, PC_IL(DCol), PC_BR(DRow), 1, 0, Length)
Dot PC_BL(DCol), PC_BL(DRow), TLClr
Dot PC_BR(DCol), PC_BL(DRow), TRClr
Dot PC_BR(DCol), PC_BR(DRow), BRClr
Dot PC_BL(DCol), PC_BR(DRow), BLClr
EndFunction
`_____________________________________________________________________________________________________
Function GetTLClr(Part)
Clr = Point(PC_IL(Part Mod 5), PC_IL(Part/5))
EndFunction Clr
`_____________________________________________________________________________________________________
Function GetTRClr(Part)
Clr = Point(PC_IR(Part Mod 5), PC_IL(Part/5))
EndFunction Clr
`_____________________________________________________________________________________________________
Function GetBRClr(Part)
Clr = Point(PC_IR(Part Mod 5), PC_IR(Part/5))
EndFunction Clr
`_____________________________________________________________________________________________________
Function GetBLClr(Part)
Clr = Point(PC_IL(Part Mod 5), PC_IR(Part/5))
EndFunction Clr
`_____________________________________________________________________________________________________
Function Mean3Clrs(Clr1, Clr2, Clr3)
Clr = RGB((RGBR(Clr1)+RGBR(Clr2)+RGBR(Clr3))/3.0, (RGBG(Clr1)+RGBG(Clr2)+RGBG(Clr3))/3.0, (RGBB(Clr1)+RGBB(Clr2)+RGBB(Clr3))/3.0)
EndFunction Clr
`_____________________________________________________________________________________________________
Function CreateSkyboxGridBitmap(Bitmap, TexSize, LeftBM, RightBM, BottomBM, TopBM, BackBM, FrontBM)
Size = TexSize / 5
Length = Size - 2
Size = Size * 5
Create Bitmap Bitmap, TexSize, TexSize
PC_BL(0) = 0
PC_BL(1) = (1*Size)/5
PC_BL(2) = (2*Size)/5
PC_BL(3) = (3*Size)/5
PC_BL(4) = (4*Size)/5
PC_IL(0) = 1
PC_IL(1) = PC_BL(1) + 1
PC_IL(2) = PC_BL(2) + 1
PC_IL(3) = PC_BL(3) + 1
PC_IL(4) = PC_BL(4) + 1
PC_BR(0) = PC_BL(1) - 1
PC_BR(1) = PC_BL(2) - 1
PC_BR(2) = PC_BL(3) - 1
PC_BR(3) = PC_BL(4) - 1
PC_BR(4) = Size - 1
PC_IR(0) = PC_BR(0) - 1
PC_IR(1) = PC_BR(1) - 1
PC_IR(2) = PC_BR(2) - 1
PC_IR(3) = PC_BR(3) - 1
PC_IR(4) = Size - 2
BMW = Bitmap Width(LeftBM): BMH = Bitmap Height(LeftBM)
Copy Bitmap LeftBM, 0, 0, BMW/2, BMH/2, Bitmap, PC_IL(0), PC_IL(0), PC_BR(0), PC_BR(0)
Copy Bitmap LeftBM, BMW/2, 0, BMW, BMH/2, Bitmap, PC_IL(1), PC_IL(0), PC_BR(1), PC_BR(0)
Copy Bitmap LeftBM, 0, BMH/2, BMW/2, BMH, Bitmap, PC_IL(2), PC_IL(0), PC_BR(2), PC_BR(0)
Copy Bitmap LeftBM, BMW/2, BMH/2, BMW, BMH, Bitmap, PC_IL(3), PC_IL(0), PC_BR(3), PC_BR(0)
BMW = Bitmap Width(RightBM): BMH = Bitmap Height(RightBM)
Copy Bitmap RightBM, 0, 0, BMW/2, BMH/2, Bitmap, PC_IL(4), PC_IL(0), PC_BR(4), PC_BR(0)
Copy Bitmap RightBM, BMW/2, 0, BMW, BMH/2, Bitmap, PC_IL(0), PC_IL(1), PC_BR(0), PC_BR(1)
Copy Bitmap RightBM, 0, BMH/2, BMW/2, BMH, Bitmap, PC_IL(1), PC_IL(1), PC_BR(1), PC_BR(1)
Copy Bitmap RightBM, BMW/2, BMH/2, BMW, BMH, Bitmap, PC_IL(2), PC_IL(1), PC_BR(2), PC_BR(1)
BMW = Bitmap Width(BottomBM): BMH = Bitmap Height(BottomBM)
Copy Bitmap BottomBM, 0, 0, BMW/2, BMH/2, Bitmap, PC_IL(3), PC_IL(1), PC_BR(3), PC_BR(1)
Copy Bitmap BottomBM, BMW/2, 0, BMW, BMH/2, Bitmap, PC_IL(4), PC_IL(1), PC_BR(4), PC_BR(1)
Copy Bitmap BottomBM, 0, BMH/2, BMW/2, BMH, Bitmap, PC_IL(0), PC_IL(2), PC_BR(0), PC_BR(2)
Copy Bitmap BottomBM, BMW/2, BMH/2, BMW, BMH, Bitmap, PC_IL(1), PC_IL(2), PC_BR(1), PC_BR(2)
BMW = Bitmap Width(TopBM): BMH = Bitmap Height(TopBM)
Copy Bitmap TopBM, 0, 0, BMW/2, BMH/2, Bitmap, PC_IL(2), PC_IL(2), PC_BR(2), PC_BR(2)
Copy Bitmap TopBM, BMW/2, 0, BMW, BMH/2, Bitmap, PC_IL(3), PC_IL(2), PC_BR(3), PC_BR(2)
Copy Bitmap TopBM, 0, BMH/2, BMW/2, BMH, Bitmap, PC_IL(4), PC_IL(2), PC_BR(4), PC_BR(2)
Copy Bitmap TopBM, BMW/2, BMH/2, BMW, BMH, Bitmap, PC_IL(0), PC_IL(3), PC_BR(0), PC_BR(3)
BMW = Bitmap Width(BackBM): BMH = Bitmap Height(BackBM)
Copy Bitmap BackBM, 0, 0, BMW/2, BMH/2, Bitmap, PC_IL(1), PC_IL(3), PC_BR(1), PC_BR(3)
Copy Bitmap BackBM, BMW/2, 0, BMW, BMH/2, Bitmap, PC_IL(2), PC_IL(3), PC_BR(2), PC_BR(3)
Copy Bitmap BackBM, 0, BMH/2, BMW/2, BMH, Bitmap, PC_IL(3), PC_IL(3), PC_BR(3), PC_BR(3)
Copy Bitmap BackBM, BMW/2, BMH/2, BMW, BMH, Bitmap, PC_IL(4), PC_IL(3), PC_BR(4), PC_BR(3)
BMW = Bitmap Width(FrontBM): BMH = Bitmap Height(FrontBM)
Copy Bitmap FrontBM, 0, 0, BMW/2, BMH/2, Bitmap, PC_IL(0), PC_IL(4), PC_BR(0), PC_BR(4)
Copy Bitmap FrontBM, BMW/2, 0, BMW, BMH/2, Bitmap, PC_IL(1), PC_IL(4), PC_BR(1), PC_BR(4)
Copy Bitmap FrontBM, 0, BMH/2, BMW/2, BMH, Bitmap, PC_IL(2), PC_IL(4), PC_BR(2), PC_BR(4)
Copy Bitmap FrontBM, BMW/2, BMH/2, BMW, BMH, Bitmap, PC_IL(3), PC_IL(4), PC_BR(3), PC_BR(4)
Lock Pixels
UTLClr = Mean3Clrs(GetTRClr( 1), GetTLClr(20), GetBLClr(14))
UTRClr = Mean3Clrs(GetTLClr( 4), GetTRClr(21), GetBRClr(15))
UBRClr = Mean3Clrs(GetTRClr(13), GetTRClr( 5), GetTLClr(16))
UBLClr = Mean3Clrs(GetTLClr( 0), GetTLClr(12), GetTRClr(17))
LTLClr = Mean3Clrs(GetBRClr( 3), GetBLClr(22), GetTLClr(19))
LBLClr = Mean3Clrs(GetBLClr( 2), GetBLClr(10), GetBRClr(19))
LBRClr = Mean3Clrs(GetBRClr( 7), GetBLClr(18), GetBRClr(11))
LTRClr = Mean3Clrs(GetBRClr(23), GetBLClr( 6), GetTRClr( 9))
_DrawBorders( 0, 17, 1, 12, 2, 0, 0,-1, 0, UBLClr, GetTLClr(14), GetTLClr( 3), GetTRClr(19), Length)
_DrawBorders( 1, 0, 20, 14, 3, 0, 0,-1, 0, GetBLClr(12), UTLClr, GetTLClr(22), GetTRClr( 2), Length)
_DrawBorders( 2, 19, 3, 0, 10, 0, 0, 0, 1, GetBRClr(17), GetBLClr( 1), GetBLClr( 8), LBLClr, Length)
_DrawBorders( 3, 2, 22, 1, 8, 0, 0, 0, 1, GetBRClr( 0), GetBLClr(20), LTLClr, GetTLClr(10), Length)
_DrawBorders( 4, 21, 5, 15, 6, 0, 0, 1, 0, UTRClr, GetTLClr( 5), GetTLClr( 7), GetTRClr(23), Length)
_DrawBorders( 5, 4, 16, 13, 7, 0, 0, 1, 0, GetTRClr(15), UBRClr, GetTLClr(18), GetTRClr( 6), Length)
_DrawBorders( 6, 23, 7, 4, 9, 0, 0, 0,-1, GetBRClr(21), GetBLClr( 5), GetTRClr(11), LTRClr, Length)
_DrawBorders( 7, 6, 18, 5, 11, 0, 0, 0,-1, GetBRClr( 4), GetBLClr(16), LBRClr, GetBRClr( 9), Length)
_DrawBorders( 8, 3, 9, 22, 10,-1, 0, 0, 0, LTLClr, GetBLClr(23), GetTLClr(11), GetBRClr( 2), Length)
_DrawBorders( 9, 8, 6, 23, 11, 0, 1, 0, 0, GetBRClr(22), LTRClr, GetBLClr( 7), GetTRClr(10), Length)
_DrawBorders(10, 2, 11, 8, 19,-1, 0, 0, 2, GetBLClr( 3), GetBLClr( 9), GetBRClr( 2), LBLClr, Length)
_DrawBorders(11, 10, 7, 9, 18, 0, 1, 0, 2, GetBRClr( 8), GetBRClr( 6), LBRClr, GetBLClr(19), Length)
_DrawBorders(12, 0, 13, 17, 14, 1, 0, 2, 0, UBLClr, GetTRClr(16), GetTLClr(15), GetTLClr( 1), Length)
_DrawBorders(13, 12, 5, 16, 15, 0,-1, 2, 0, GetTLClr(17), UBRClr, GetTRClr( 4), GetTRClr(14), Length)
_DrawBorders(14, 1, 15, 12, 20, 1, 0, 0, 0, GetTRClr( 0), GetBLClr(13), GetTLClr(21), UTLClr, Length)
_DrawBorders(15, 14, 4, 13, 21, 0,-1, 0, 0, GetBRClr(12), GetTLClr( 5), UTRClr, GetTRClr(20), Length)
_DrawBorders(16, 5, 17, 13, 18, 0, 0, 2, 0, UBRClr, GetTRClr(12), GetTLClr(19), GetTRClr( 7), Length)
_DrawBorders(17, 16, 0, 12, 19, 0, 0, 2, 0, GetTLClr(13), UBLClr, GetTLClr( 2), GetTRClr(18), Length)
_DrawBorders(18, 7, 19, 16, 11, 0, 0, 0, 2, GetBRClr( 5), GetBLClr(17), GetBRClr(10), LBRClr, Length)
_DrawBorders(19, 18, 2, 17, 10, 0, 0, 0, 2, GetBRClr(16), GetBLClr( 0), LBLClr, GetBLClr(11), Length)
_DrawBorders(20, 1, 21, 14, 22, 0, 0, 0, 0, UTLClr, GetBLClr(15), GetTLClr(23), GetTRClr( 3), Length)
_DrawBorders(21, 20, 4, 15, 23, 0, 0, 0, 0, GetBRClr(14), UTRClr, GetTLClr( 6), GetTRClr(22), Length)
_DrawBorders(22, 3, 23, 20, 8, 0, 0, 0, 0, GetBRClr( 1), GetBLClr(21), GetTLClr( 9), LTLClr, Length)
_DrawBorders(23, 22, 6, 21, 9, 0, 0, 0, 0, GetBRClr(20), GetBLClr( 4), LTRClr, GetTRClr( 8), Length)
Unlock Pixels
EndFunction
Requires the
IanM's Matrix1DLLs
I use the skybox sample from
Here
Generated texture in the download