PB 5.10 x86 FinishMesh(#True) Crash

Everything related to 3D programming
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

PB 5.10 x86 FinishMesh(#True) Crash

Post 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?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PB 5.10 x86 FinishMesh(#True) Crash

Post 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!
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply