Error with FinishMesh()
Posted: Mon Jun 09, 2014 12:01 pm
HELLO PB-Community!
I need your help with a manual mesh creation:
I want to create a mesh made out of cubes like in minecraft. Some cubes have transparent materials the rest don't. The transparent blocks are added as SubMeshs so i can assign a different material to them.The first SubMesh contains all non transparent cubes and the are added first. The transparent blocks are added afterwards. The problem is that my code runs fine when i only render transparent blocks or the untransparent ones. When i want to render them both i always get a compiler error (invalid memory access) with FinishMesh(#True) in line 560 !!! When i outcommend one of them there is no error when compiling (line 532/552):
Here is the download link: https://www.dropbox.com/s/c703hwjcmvdxd ... blocks.zip
Thanks for having a look into my code!
A.D.
I need your help with a manual mesh creation:
I want to create a mesh made out of cubes like in minecraft. Some cubes have transparent materials the rest don't. The transparent blocks are added as SubMeshs so i can assign a different material to them.The first SubMesh contains all non transparent cubes and the are added first. The transparent blocks are added afterwards. The problem is that my code runs fine when i only render transparent blocks or the untransparent ones. When i want to render them both i always get a compiler error (invalid memory access) with FinishMesh(#True) in line 560 !!! When i outcommend one of them there is no error when compiling (line 532/552):
Code: Select all
Global CamSpeed = 2.8 , CamMode = 1 , RenderMode = 0, FullScreen = 0
Global KeyX, KeyY, RollZ, RotX, RotY, MouseX, MouseY, FPS, VSync = 1
Global xa,ya,za, cubeSize = 1 , tilesize = 64, texturepack.s
#RenderGlass = 1
#MultiTex = 0
Declare InitWorld()
Declare Keyboard()
Declare LoadBuilding(filename.s)
Declare.i MakeMeshFromBuilding()
Procedure InitWorld()
InitEngine3D()
InitSprite()
InitKeyboard()
InitMouse()
UsePNGImageDecoder()
Add3DArchive("\", #PB_3DArchive_FileSystem)
AntialiasingMode(#PB_AntialiasingMode_x6)
If Not FullScreen
OpenWindow(0,0,0,800,600,"CreepyBlocks",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),0,0,800,600,0,0,0,VSync)
Else
ExamineDesktops()
OpenScreen(DesktopWidth(0),DesktopHeight(0),32,"",VSync)
EndIf
CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, -30, 30,-40,#PB_Absolute)
RotateCamera(0,-90,0, 180)
CameraBackColor(0, $382423)
lx = -30 : lz = za*cubesize+20 : ly = ya * cubesize+30
CreateLight(0,$FFFFFF,lx,ly,lz,#PB_Light_Directional);#PB_Light_Point)
;CreateLight(1,$FFFFFF,-30,200,30,#PB_Light_Point)
LightAttenuation(0, 900, 600)
;LightAttenuation(1, 2900, 0)
;Sun(0,1000, 100,$E8FEFF)
;AmbientColor($28D7DE)
; Ground Plane
img=CatchImage(#PB_Any, ?i0)
tex=CreateTexture(#PB_Any, tilesize, tilesize)
StartDrawing(TextureOutput(tex))
DrawImage(ImageID(img),0,0)
StopDrawing()
mat=CreateMaterial(#PB_Any, TextureID(tex))
mesh=CreatePlane(#PB_Any, 150, 150, 80, 80, 80, 80)
ent=CreateEntity(#PB_Any,MeshID(Mesh), MaterialID(mat), 0, 0, 0)
ScaleEntity(ent,4,4,4) : EntityRenderMode(ent,0)
;CameraLookAt(0,EntityX(ent),EntityY(ent),EntityZ(ent))
LightLookAt(0,EntityX(ent),EntityY(ent),EntityZ(ent))
WorldShadows(#PB_Shadow_TextureAdditive,-1,$00000000,512) ;#PB_Shadow_TextureAdditive, 200) #PB_Shadow_Additive #PB_Shadow_Modulative
;EntityRenderMode(ent, 0)
EndProcedure
Procedure Keyboard()
ExamineKeyboard()
If KeyboardPushed(#PB_Key_A)
keyx = -1
ElseIf KeyboardPushed(#PB_Key_D)
keyx = 1
Else
keyx = 0
EndIf
If KeyboardPushed(#PB_Key_W)
keyy = -1
ElseIf KeyboardPushed(#PB_Key_S)
keyy = 1
Else
keyy = 0
EndIf
If KeyboardPushed(#PB_Key_PageUp)
rollz = 1
ElseIf KeyboardPushed(#PB_Key_PageDown)
rollz = -1
Else
rollz=0
EndIf
If KeyboardReleased(#PB_Key_Space)
EndIf
If KeyboardReleased(#PB_Key_F1)
;MoveCamera(0, -30, 30, -40,#PB_Absolute)
;CameraLookAt(0,EntityX(0),EntityY(0),EntityZ(0))
;RotateCamera(0,-90,0, 180)
EndIf
If KeyboardReleased(#PB_Key_F2)
Rendermode = Rendermode + 1
Select Rendermode
Case 0 : CameraRenderMode(0, #PB_Camera_Textured)
Case 1 : CameraRenderMode(0, #PB_Camera_Wireframe)
Case 2 : CameraRenderMode(0, #PB_Camera_Plot)
EndSelect
If Rendermode = 2 : Rendermode = -1 : EndIf
EndIf
If KeyboardReleased(#PB_Key_F3)
If CamMode = #True : CamMode = #False : Else : CamMode = #True : EndIf
EndIf
ExamineMouse()
rotx = 0 : roty = 0
mousex = -MouseDeltaX()
mousey = -MouseDeltaY()
If MouseButton(#PB_MouseButton_Right)
rotx = mousey
roty = mousex
mousex = 0
mousey = 0
EndIf
EndProcedure
Procedure LoadBuilding(filename.s)
File$ = filename
If ReadFile(0, File$)
MapSize$ = ReadString(0)
Dummy$ = ReadString(0)
texturepack.s = Mid(MapSize$,FindString(MapSize$,";")+1)
xa = Val(StringField(MapSize$, 1, "x"))
ya = Val(StringField(MapSize$, 2, "x"))
za = Val(StringField(MapSize$, 3, "x"))
Swap ya,za
Global Dim MapArray(xa, za, ya)
ii=1
;ArrayWerte setzen
While ii <= za
Layer$ = ReadString(0)
Repeat
iy + 1
line$ = ReadString(0)
If Line$ = Chr(10) Or Len(Line$) <> xa
iy = 0 : ii + 1
Break
Else
For ix = 1 To Len(Line$)
MapArray(ix,iy,ii) = Asc(Mid(Line$,ix,1))-47 ;c -32
Next ix
EndIf
ForEver
Wend
CloseFile(0)
Else
MessageRequester("Error","Could Not Open File !")
End
EndIf
EndProcedure
Procedure RestoreFaces(front, back, left, right, top, bottom, amount, id, ix, iy, iz, submesh)
f1= 0 : f2= 1 : f3= 2
f4= 0 : f5= 2 : f6= 3
Static Offset
If SubMesh <> 0 : AddSubMesh() : Offset = 0 : EndIf
If Front = 1
Restore Front
For i = 1 To 4
Read.f x.f : Read.f y.f : Read.f z.f : Read.f u.f : Read.f v.f : Read.f nx : Read.f ny : Read.f nz
MeshVertexPosition(ix+x.f,iy+y.f, iz+z.f)
If SubMesh = 0
u.f = 1/6 * u.f + (0*(1/6))
If v.f=1.0:v.f=0.0:Else:v.f=1.0:EndIf
v.f = 1/amount * id - 1/amount * v.f
EndIf
MeshVertexTextureCoordinate(u.f,v.f)
MeshVertexNormal(nx,ny,nz)
Next i
MeshFace(f1+Offset,f2+Offset,f3+Offset)
MeshFace(f4+Offset,f5+Offset,f6+Offset)
Offset+4
EndIf
If Back = 1
Restore Back
If #MultiTex = 0 : umt = 0 : Else : umt=1 : EndIf
For i = 1 To 4
Read.f x.f : Read.f y.f : Read.f z.f : Read.f u.f : Read.f v.f : Read.f nx : Read.f ny : Read.f nz
MeshVertexPosition(ix+x.f,iy+y.f, iz+z.f)
If SubMesh = 0
u.f = 1/6 * u.f + (umt*(1/6))
If v.f=1.0:v.f=0.0:Else:v.f=1.0:EndIf
v.f = 1/amount * id - 1/amount * v.f
EndIf
MeshVertexTextureCoordinate(u.f,v.f)
MeshVertexNormal(nx,ny,nz)
Next i
MeshFace(f1+Offset,f2+Offset,f3+Offset)
MeshFace(f4+Offset,f5+Offset,f6+Offset)
Offset+4
EndIf
If Right = 1
Restore Right
If #MultiTex = 0 : umt = 0 : Else : umt=2 : EndIf
For i = 1 To 4
Read.f x.f : Read.f y.f : Read.f z.f : Read.f u.f : Read.f v.f : Read.f nx : Read.f ny : Read.f nz
MeshVertexPosition(ix+x.f,iy+y.f, iz+z.f)
If SubMesh = 0
u.f = 1/6 * u.f + (umt*(1/6))
If v.f=1.0:v.f=0.0:Else:v.f=1.0:EndIf
v.f = 1/amount * id - 1/amount * v.f
EndIf
MeshVertexTextureCoordinate(u.f,v.f)
MeshVertexNormal(nx,ny,nz)
Next i
MeshFace(f1+Offset,f2+Offset,f3+Offset)
MeshFace(f4+Offset,f5+Offset,f6+Offset)
Offset+4
EndIf
If Left = 1
Restore Left
If #MultiTex = 0 : umt = 0 : Else : umt=3 : EndIf
For i = 1 To 4
Read.f x.f : Read.f y.f : Read.f z.f : Read.f u.f : Read.f v.f : Read.f nx : Read.f ny : Read.f nz
MeshVertexPosition(ix+x.f,iy+y.f, iz+z.f)
If SubMesh = 0
u.f = 1/6 * u.f + (umt*(1/6))
If v.f=1.0:v.f=0.0:Else:v.f=1.0:EndIf
v.f = 1/amount * id - 1/amount * v.f
EndIf
MeshVertexTextureCoordinate(u.f,v.f)
MeshVertexNormal(nx,ny,nz)
Next i
MeshFace(f1+Offset,f2+Offset,f3+Offset)
MeshFace(f4+Offset,f5+Offset,f6+Offset)
Offset+4
EndIf
If Top = 1
Restore Top
If #MultiTex = 0 : umt = 0 : Else : umt=4 : EndIf
For i = 1 To 4
Read.f x.f : Read.f y.f : Read.f z.f : Read.f u.f : Read.f v.f : Read.f nx : Read.f ny : Read.f nz
MeshVertexPosition(ix+x.f,iy+y.f, iz+z.f)
If SubMesh = 0
u.f = 1/6 * u.f + (umt*(1/6))
If v.f=1.0:v.f=0.0:Else:v.f=1.0:EndIf
v.f = 1/amount * id - 1/amount * v.f
EndIf
MeshVertexTextureCoordinate(u.f,v.f)
MeshVertexNormal(nx,ny,nz)
Next i
MeshFace(f1+Offset,f2+Offset,f3+Offset)
MeshFace(f4+Offset,f5+Offset,f6+Offset)
Offset+4
EndIf
If Bottom = 1
Restore Bottom
If #MultiTex = 0 : umt = 0 : Else : umt=5 : EndIf
For i = 1 To 4
Read.f x.f : Read.f y.f : Read.f z.f : Read.f u.f : Read.f v.f : Read.f nx : Read.f ny : Read.f nz
MeshVertexPosition(ix+x.f,iy+y.f, iz+z.f)
If SubMesh = 0
u.f = 1/6 * u.f + (umt*(1/6))
If v.f=1.0:v.f=0.0:Else:v.f=1.0:EndIf
v.f = 1/amount * id - 1/amount * v.f
EndIf
MeshVertexTextureCoordinate(u.f,v.f)
MeshVertexNormal(nx,ny,nz)
Next i
MeshFace(f1+Offset,f2+Offset,f3+Offset)
MeshFace(f4+Offset,f5+Offset,f6+Offset)
Offset+4
EndIf
EndProcedure
Procedure MakeMeshFromBuilding()
UsePNGImageDecoder()
cube=CreateCube(#PB_Any,cubeSize)
UseZipPacker()
If OpenPack(0, texturepack)
If ExaminePack(0)
While NextPackEntry(0)
amount+1
Wend
EndIf
Dim TextureName.s(amount)
Dim TransparentMat(1) : it=1
Dim TransArray(3,1)
Dim TransTex(1)
If ExaminePack(0)
While NextPackEntry(0)
i+1
TextureName(i) = RemoveString(PackEntryName(0),".png", #PB_String_NoCase)
*mem=AllocateMemory(PackEntrySize(0))
UncompressPackMemory(0, *mem, MemorySize(*mem))
img=CatchImage(#PB_Any,*mem) : FreeMemory(*mem)
If i=1 : height = ImageHeight(img) : MeshImg=CreateImage(#PB_Any, height*6,height*amount, 24) : EndIf
StartDrawing(ImageOutput(MeshImg))
DrawImage(ImageID(img), 0, (i-1)*height)
StopDrawing()
If Mid(TextureName(i),1,2) = "t."
TransparentMat(it) = i
tex = CreateTexture(#PB_Any, ImageWidth(img), ImageHeight(img))
StartDrawing(TextureOutput(tex))
DrawAlphaImage(ImageID(Img),0,0,130)
StopDrawing()
TransTex(it)=CreateMaterial(#PB_Any, TextureID(tex))
MaterialBlendingMode(TransTex(it), #PB_Material_AlphaBlend)
it+1 : ReDim TransparentMat(it) : ReDim TransTex(it)
EndIf
FreeImage(img)
Wend
EndIf
ClosePack(0)
EndIf
tex = CreateTexture(#PB_Any, ImageWidth(MeshImg), ImageHeight(MeshImg))
StartDrawing(TextureOutput(tex))
DrawImage(ImageID(MeshImg),0,0,ImageWidth(MeshImg), ImageHeight(MeshImg))
StopDrawing()
Mat = CreateMaterial(#PB_Any,TextureID(tex))
height = ImageHeight(MeshImg)
width = ImageWidth(MeshImg)
FreeImage(MeshImg)
;MaterialBlendingMode(Material(i), #PB_Material_AlphaBlend)
; DisableMaterialLighting(Material(i),#True)
; MaterialShadingMode(Material(i), #PB_Material_Phong)
; MaterialCullingMode(Material(i), #PB_Material_NoCulling);PB_Material_ClockWiseCull); #PB_Material_NoCulling);#PB_Material_AntiClockWiseCull)
; MaterialShininess(Material(i),0.4) : MaterialShadingMode(Material(i), #PB_Material_Phong) ;: SetMaterialColor(Material(i), #PB_Material_SelfIlluminationColor, $E319DF)
Mesh = CreateMesh(#PB_Any) : AddSubMesh()
For iy = 1 To ya
For iz = 1 To za
For ix = 1 To xa
id = MapArray(ix,iz,iy)
If Not id = 0
For i = 1 To ArraySize(TransparentMat(),2)-1
If TransparentMat(i) = id
TransArray(1,ArraySize(TransArray(),2)) = ix
TransArray(2,ArraySize(TransArray(),2)) = iy
TransArray(3,ArraySize(TransArray(),2)) = iz
ta=ArraySize(TransArray(),2)+1
ReDim TransArray(3,ta)
nope=1 : Break
Else
nope=0
EndIf
Next i
;{ RenderGlass = 1
CompilerIf #RenderGlass = 1
If ix > 1
For i = 1 To ArraySize(TransparentMat())
If MapArray(ix-1,iz,iy) = TransparentMat(i) : ts = 1 : Break : EndIf : ts=0
Next i
If MapArray(ix-1,iz,iy) = 0 And ts = 0
left=1
Else
left = 0
EndIf
If ts = 1
left=1
EndIf
EndIf
If ix=1 : left=1 : EndIf
If ix + 1 <= xa
For i = 1 To ArraySize(TransparentMat())
If MapArray(ix+1,iz,iy) = TransparentMat(i) : ts = 1 : Break : EndIf : ts=0
Next i
If MapArray(ix+1,iz,iy) = 0 And ts = 0
right=1
Else
right = 0
EndIf
If ts = 1
right=1
EndIf
EndIf
If ix=xa : right=1 : EndIf
If iy > 1
For i = 1 To ArraySize(TransparentMat())
If MapArray(ix,iz,iy-1) = TransparentMat(i) : ts = 1 : Break : EndIf : ts=0
Next i
If MapArray(ix1,iz,iy-1) = 0 And ts = 0
bottom=1
Else
bottom = 0
EndIf
If ts = 1
bottom=1
EndIf
EndIf
If iy=1 : bottom =1 : EndIf
If iy + 1 <= ya
For i = 1 To ArraySize(TransparentMat())
If MapArray(ix,iz,iy+1) = TransparentMat(i) : ts = 1 : Break : EndIf : ts=0
Next i
If MapArray(ix,iz,iy+1) = 0 And ts = 0
top=1
Else
top = 0
EndIf
If ts = 1
top=1
EndIf
EndIf
If iy=ya : top=1 : EndIf
If iz > 1
For i = 1 To ArraySize(TransparentMat())
If MapArray(ix,iz-1,iy) = TransparentMat(i) : ts = 1 : Break : EndIf : ts=0
Next i
If MapArray(ix,iz-1,iy) = 0 And ts = 0
back=1
Else
back = 0
EndIf
If ts = 1
back=1
EndIf
EndIf
If iz=1 : back=1 : EndIf
If iz + 1 <= za
For i = 1 To ArraySize(TransparentMat())
If MapArray(ix,iz+1,iy) = TransparentMat(i) : ts = 1 : Break : EndIf : ts=0
Next i
If MapArray(ix,iz+1,iy) = 0 And ts = 0
front=1
Else
front = 0
EndIf
If ts = 1
front=1
EndIf
EndIf
If iz=za : front=1 : EndIf
CompilerEndIf
;}
;{ RenderGlass = 0
; CompilerIf #RenderGlass= 0
;
; If ix > 1 : If MapArray(ix-1,iz,iy) = 0 : left=1 : Else : left = 0 : EndIf : EndIf : If ix=1 : left=1 : EndIf
; If ix+1 <= xa : If MapArray(ix+1,iz,iy) = 0 : right=1 : Else : right = 0 : EndIf : EndIf : If ix= xa : right = 1 : EndIf
;
; If iy > 1 : If MapArray(ix,iz,iy-1) = 0 : bottom=1 : Else : bottom = 0 : EndIf : EndIf : If iy=1 : bottom = 1 : EndIf
; If iy+1 <= ya : If MapArray(ix,iz,iy+1) = 0 : top=1 : Else : top = 0 : EndIf : EndIf : If iy=ya : top=1 : EndIf
;
; If iz > 1 : If MapArray(ix,iz-1,iy) = 0 : back=1 : Else : back = 0 : EndIf : EndIf : If iz=1 : back = 1 : EndIf
; If iz+1 <= za : If MapArray(ix,iz+1,iy) = 0 : front=1 : Else : front = 0 : EndIf : EndIf : If iz=za : front = 1 : EndIf
;
; For i = 1 To ArraySize(TransparentMat())
; If TransparentMat(i) = id : front = 1 : back = 1 : right = 1 : left = 1 : top = 1 : bottom = 1 : EndIf
; Next i
;
; CompilerEndIf
;}
If Nope = 1 : front = 0 : back = 0 : right = 0 : left = 0 : top = 0 : bottom = 0 : EndIf
;front = 1 : back = 1 : right = 1 : left = 1 : top = 1 : bottom = 1
If Not (front=0 And back=0 And right=0 And left=0 And top=0 And bottom=0)
;- outcommend here to render the cubes without transparent material ->
RestoreFaces(front, back, left, right, top, bottom, amount, id, ix, iy, iz, 0)
EndIf
EndIf
Next ix
Next iz
Next iy
SubMesh= 0
;Debug ArraySize(TransArray(),1)
For i = 1 To ArraySize(TransArray(),2)-1
SubMesh + 1
ix = TransArray(1,i)
iy = TransArray(2,i)
iz = TransArray(3,i)
id = MapArray(ix,iz,iy)
;- remove comment here for the cubes with alphablending ->
;RestoreFaces(1,1,1,1,1,1, amount, id, ix, iy, iz, SubMesh)
For ii = 1 To ArraySize(TransparentMat(),2)-1
If TransparentMat(ii) = id : tex = ii : EndIf
Next ii
SetMeshMaterial(Mesh, MaterialID(TransTex(tex)))
Next i
FinishMesh(#True)
SetMeshMaterial(Mesh, MaterialID(Mat),0)
BuildMeshTangents(Mesh)
BuildMeshShadowVolume(Mesh)
UpdateMeshBoundingBox(Mesh)
;TransformMesh(Mesh,0,0,0,1,1,1,0,0,0) ;(MeshRadius(Mesh)/2)*-1
NormalizeMesh(Mesh)
FreeArray(MapArray())
FreeArray(TextureName())
FreeArray(TransparentMat())
ProcedureReturn Mesh
EndProcedure
;- Start
LoadBuilding("house.txt")
InitWorld() : CreateSprite(0,60,30) : ;WorldDebug(#PB_World_DebugEntity)
Mesh=MakeMeshFromBuilding()
house=CreateEntity(#PB_Any,MeshID(Mesh),#PB_Material_None,0,0,0) : CameraLookAt(0,EntityX(house),EntityY(house),EntityZ(house)) : EntityRenderMode(house, #PB_Entity_CastShadow)
CreateCylinder(99,5,10) : CreateEntity(99,MeshID(99),#PB_Material_None,lx,ly,lz) : ScaleEntity(99,0.1,0.1,0.1)
;MoveEntity(99,LightX(0),LightY(0),LightZ(0),#PB_Absolute)
Repeat
If Not Fullscreen
Select WaitWindowEvent(10)
Case #PB_Event_CloseWindow
Quit = #True
EndSelect
EndIf
Keyboard()
;If CamMode : RotateEntity(99, 0, 0.5, 0, #PB_Relative) : EndIf
;MoveEntity(99, EntityX(99)+keyy, EntityY(99)+rollz, EntityZ(99)-keyx,#PB_Absolute) ; MoveEntity(99, keyy, rollz, -keyx,#PB_Relative)
;CameraFollow(0, EntityID(99), 90, EntityY(99) + 12, 35, 1,1,#True)
If CamMode
RotateCamera(0, mousey, mousex, 0,#PB_Relative)
MoveCamera (0, keyx*CamSpeed/2, 0, keyy*CamSpeed/2)
EndIf
FPS = Engine3DFrameRate(#PB_Engine3D_Current)
RenderWorld()
StartDrawing(SpriteOutput(0)) :
DrawText(2,2,Str(FPS))
;DrawText(2,2,Str(CameraX(0)) +" " + Str(CameraY(0))+" "+ Str(CameraZ(0)))
;DrawText(2,2,Str(MeshVertexCount(mesh)))
StopDrawing()
DisplaySprite(0,5,5)
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit
DataSection
i0:
IncludeBinary "grass.png"
EndDataSection
CompilerIf #MultiTex = 0 ; SINGLE TEX DataSection
DataSection
Front:
Data.f -0.5, -0.5, 0.5
Data.f 0.0, 1.0
Data.f 0.0, 0.0, 1.0
Data.f 0.5, -0.5, 0.5
Data.f 1.0, 1.0
Data.f 0.0, 0.0, 1.0
Data.f 0.5, 0.5, 0.5
Data.f 1.0, 0.0
Data.f 0.0, 0.0, 1.0
Data.f -0.5, 0.5, 0.5
Data.f 0.0, 0.0
Data.f 0.0, 0.0, 1.0
Back:
Data.f 0.5, -0.5, -0.5
Data.f 0.0, 1.0
Data.f 0.0, 0.0, -1.0
Data.f -0.5, -0.5, -0.5
Data.f 1.0, 1.0
Data.f 0.0, 0.0, -1.0
Data.f -0.5, 0.5, -0.5
Data.f 1.0, 0.0
Data.f 0.0, 0.0, -1.0
Data.f 0.5, 0.5, -0.5
Data.f 0.0, 0.0
Data.f 0.0, 0.0, -1.0
Left:
Data.f -0.5, -0.5, -0.5
Data.f 0.0, 1.0
Data.f -1.0, 0.0, 0.0
Data.f -0.5, -0.5, 0.5
Data.f 1.0, 1.0
Data.f -1.0, 0.0, 0.0
Data.f -0.5, 0.5, 0.5
Data.f 1.0, 0.0
Data.f -1.0, 0.0, 0.0
Data.f -0.5, 0.5, -0.5
Data.f 0.0, 0.0
Data.f -1.0, 0.0, 0.0
Right:
Data.f 0.5, -0.5, 0.5
Data.f 0.0, 1.0
Data.f 1.0, 0.0, 0.0
Data.f 0.5, -0.5, -0.5
Data.f 1.0, 1.0
Data.f 1.0, 0.0, 0.0
Data.f 0.5, 0.5, -0.5
Data.f 1.0, 0.0
Data.f 1.0, 0.0, 0.0
Data.f 0.5, 0.5, 0.5
Data.f 0.0, 0.0
Data.f 1.0, 0.0, 0.0
Top:
Data.f -0.5, 0.5, 0.5
Data.f 0.0, 1.0
Data.f 0.0, 1.0, 0.0
Data.f 0.5, 0.5, 0.5
Data.f 1.0, 1.0
Data.f 0.0, 1.0, 0.0
Data.f 0.5, 0.5, -0.5
Data.f 1.0, 0.0
Data.f 0.0, 1.0, 0.0
Data.f -0.5, 0.5, -0.5
Data.f 0.0, 0.0
Data.f 0.0, 1.0, 0.0
Bottom:
Data.f -0.5, -0.5, -0.5
Data.f 0.0, 1.0
Data.f 0.0, -1.0, 0.0
Data.f 0.5, -0.5, -0.5
Data.f 1.0, 1.0
Data.f 0.0, -1.0, 0.0
Data.f 0.5, -0.5, 0.5
Data.f 1.0, 0.0
Data.f 0.0, -1.0, 0.0
Data.f -0.5, -0.5, 0.5
Data.f 0.0, 0.0
Data.f 0.0, -1.0, 0.0
EndDataSection
CompilerElse
DataSection ;MULTI TEX DataSection
Front:
Data.f -0.5, -0.5, 0.5
Data.f 0.0, 1.0
Data.f 0.0, 0.0, 1.0
Data.f 0.5, -0.5, 0.5
Data.f 0.166, 1.0
Data.f 0.0, 0.0, 1.0
Data.f 0.5, 0.5, 0.5
Data.f 0.166, 0.0
Data.f 0.0, 0.0, 1.0
Data.f -0.5, 0.5, 0.5
Data.f 0.0, 0.0
Data.f 0.0, 0.0, 1.0
Back:
Data.f 0.5, -0.5, -0.5
Data.f 0.166, 1.0
Data.f 0.0, 0.0, -1.0
Data.f -0.5, -0.5, -0.5
Data.f 0.333, 1.0
Data.f 0.0, 0.0, -1.0
Data.f -0.5, 0.5, -0.5
Data.f 0.333, 0.0
Data.f 0.0, 0.0, -1.0
Data.f 0.5, 0.5, -0.5
Data.f 0.166, 0.0
Data.f 0.0, 0.0, -1.0
Left:
Data.f -0.5, -0.5, -0.5
Data.f 0.333, 1.0
Data.f -1.0, 0.0, 0.0
Data.f -0.5, -0.5, 0.5
Data.f 0.5, 1.0
Data.f -1.0, 0.0, 0.0
Data.f -0.5, 0.5, 0.5
Data.f 0.5, 0.0
Data.f -1.0, 0.0, 0.0
Data.f -0.5, 0.5, -0.5
Data.f 0.333, 0.0
Data.f -1.0, 0.0, 0.0
Right:
Data.f 0.5, -0.5, 0.5
Data.f 0.5, 1.0
Data.f 1.0, 0.0, 0.0
Data.f 0.5, -0.5, -0.5
Data.f 0.666, 1.0
Data.f 1.0, 0.0, 0.0
Data.f 0.5, 0.5, -0.5
Data.f 0.666, 0.0
Data.f 1.0, 0.0, 0.0
Data.f 0.5, 0.5, 0.5
Data.f 0.5, 0.0
Data.f 1.0, 0.0, 0.0
Top:
Data.f -0.5, 0.5, 0.5
Data.f 0.666, 1.0
Data.f 0.0, 1.0, 0.0
Data.f 0.5, 0.5, 0.5
Data.f 0.833, 1.0
Data.f 0.0, 1.0, 0.0
Data.f 0.5, 0.5, -0.5
Data.f 0.833, 0.0
Data.f 0.0, 1.0, 0.0
Data.f -0.5, 0.5, -0.5
Data.f 0.666, 0.0
Data.f 0.0, 1.0, 0.0
Bottom:
Data.f -0.5, -0.5, -0.5
Data.f 0.833, 1.0
Data.f 0.0, -1.0, 0.0
Data.f 0.5, -0.5, -0.5
Data.f 1.0, 1.0
Data.f 0.0, -1.0, 0.0
Data.f 0.5, -0.5, 0.5
Data.f 1.0, 0.0
Data.f 0.0, -1.0, 0.0
Data.f -0.5, -0.5, 0.5
Data.f 0.833, 0.0
Data.f 0.0, -1.0, 0.0
EndDataSection
CompilerEndIf
Here is the download link: https://www.dropbox.com/s/c703hwjcmvdxd ... blocks.zip
Thanks for having a look into my code!
A.D.