Page 1 of 1

PB 5.10 x86 FinishMesh(#True) Crash

Posted: Sat Feb 16, 2013 12:01 am
by IdeasVacuum
PB 5.10 Final x86 on XP 32bit

If creating a Static Mesh, FinishMesh(#True) crashes with:

Microsoft Visual C++ Runtime Library
Runtime Error!
Program: ..._DrvC\Test3D\PureBasic_Compilation0.exe
abnormal program termination

Code: Select all

IncludeFile "C:\Program Files\PureBasic510\Examples\3D\Screen3DRequester.pb"

NewList sgListPts.s()
sgDelim.s = Chr(44)

Restore MeshPoints

For i = 1 To 36

      AddElement(sgListPts())
      Read.s sgListPts()

Next i

         If InitEngine3D()

                  InitSprite()
                InitKeyboard()
                   InitMouse()

                If Screen3DRequester()
                
                       CreateMesh(0, #PB_Mesh_TriangleList, #PB_Mesh_Static)
                       
                       FirstElement(sgListPts())
                       
                       ForEach sgListPts()
                       
                                  MeshFace(ValD(StringField(sgListPts(),1,sgDelim)), ValD(StringField(sgListPts(),2,sgDelim)), ValD(StringField(sgListPts(),3,sgDelim)))
                               NextElement(sgListPts())
                       Next
                       
                       FinishMesh(#True)
                EndIf
         EndIf

End

DataSection
MeshPoints:
Data$ "50.0000,-50.0000,-50.0000"
Data$ "50.0000,-50.0000,-50.0000"
Data$ "50.0000,-50.0000,-50.0000"
Data$ "50.0000,-50.0000,-50.0000"
Data$ "50.0000,-50.0000,-50.0000"
Data$ "50.0000,-50.0000,50.0000"
Data$ "50.0000,-50.0000,50.0000"
Data$ "50.0000,-50.0000,50.0000"
Data$ "50.0000,-50.0000,50.0000"
Data$ "-50.0000,-50.0000,50.0000"
Data$ "-50.0000,50.0000,-50.0000"
Data$ "-50.0000,50.0000,-50.0000"
Data$ "-50.0000,50.0000,-50.0000"
Data$ "-50.0000,50.0000,-50.0000"
Data$ "-50.0000,50.0000,50.0000"
Data$ "-50.0000,50.0000,50.0000"
Data$ "-50.0000,50.0000,50.0000"
Data$ "-50.0000,50.0000,50.0000"
Data$ "50.0000,-50.0000,-50.0000"
Data$ "50.0000,-50.0000,-50.0000"
Data$ "50.0000,-50.0000,-50.0000"
Data$ "50.0000,-50.0000,-50.0000"
Data$ "50.0000,-50.0000,50.0000"
Data$ "50.0000,-50.0000,50.0000"
Data$ "50.0000,-50.0000,50.0000"
Data$ "50.0000,-50.0000,50.0000"
Data$ "50.0000,50.0000,-50.0000"
Data$ "50.0000,50.0000,-50.0000"
Data$ "50.0000,50.0000,-50.0000"
Data$ "50.0000,50.0000,-50.0000"
Data$ "50.0000,50.0000,-50.0000"
Data$ "50.0000,50.0000,50.0000"
Data$ "50.0000,50.0000,50.0000"
Data$ "50.0000,50.0000,50.0000"
Data$ "50.0000,50.0000,50.0000"
Data$ "50.0000,50.0000,50.0000"
EndDataSection
Can anybody confirm this?

Re: PB 5.10 x86 FinishMesh(#True) Crash

Posted: Sat Feb 16, 2013 6:11 am
by IdeasVacuum
See http://www.purebasic.fr/english/viewtop ... 68#p404768
The crash occurs because the Mesh is invalid. Would be nice if a crash could be avoided because in the real world the mesh is created from a file (not a mesh file, so can't use LoadMesh()). So, more thinking to do!