MD2 bug in klepto-version?

BlitzMax Forums/MiniB3D Module/MD2 bug in klepto-version?

TheSin(Posted 2007) [#1]
SuperStrict

Import sidesign.minib3d

Graphics3D(640,480)

Local camera:TCamera = CreateCamera()

CameraViewport(camera,0,0,GraphicsWidth(),GraphicsHeight())

Local explostar:TMesh = LoadMD2("explostar.md2")

MoveEntity(explostar,0,0,5)

While Not KeyHit(27)

	TurnEntity(explostar,1,1,1)
	
	UpdateWorld()
	
	RenderWorld()

	Flip()
		
Wend


This litttle program gives me an error (Attempt to index array element beyond array length) regardless of what size the md2 mesh is. I use AC3D to export and I'm using an Intel Mac.


klepto2(Posted 2007) [#2]
without the model it is hard to say whats going wrong ;)
maybe you could send it to me (I will handle it with respect).


TheSin(Posted 2007) [#3]
Email sent ^^
It's just a triangulated sphere =)


klepto2(Posted 2007) [#4]
Bug found:

If you could build your module by yourself, then change the following in the TMD2.bmx:
Local Surface:TSurface = CreateSurface(Mesh)
Local Frame:TMD2Frame = Frames[1] ' this is the bug
Local c:Int = 0

to
Local Surface:TSurface = CreateSurface(Mesh)
Local Frame:TMD2Frame = Frames[0]
Local c:Int = 0


its in the method BuildMesh() on line:
130

I hope this will help you.


TheSin(Posted 2007) [#5]
This did the job, thank you ^^