Creating Terrain Mesh

Started by
0 comments, last by TAlchemist 18 years ago
i am having a problem. i got the terrain creation system down. using manual vertex buffers and index buffers. now i am trying to go to a mesh object. my code here works great on my pc at work but at home on my laptop it sometimes works, sometimes locks up, and even when it works it doesnt always render. using some debug statements i can find the crash to be after the vertex buffer is filled in the mesh but before the index buffer is finished. here is the mesh creation code and the parts i is an array of int16's that describe the faces of the model v is the array of CustomVertex.PositionNormalTextured *code* tmesh = New Mesh(i.GetUpperBound(0) / 3, v.GetUpperBound(0), 0,CustomVertex.PositionNormalTextured.Format, Me.dev) Me.AddToDebugger("Building TerrainMesh: Mesh Created") tmesh.SetVertexBufferData(v, LockFlags.NoSystemLock) Me.AddToDebugger("Building TerrainMesh: Mesh vb filled") ' usually gets passed here but no more debug statments are written tmesh.SetIndexBufferData(i, LockFlags.NoSystemLock) Me.AddToDebugger("Building TerrainMesh: Mesh ib filled")
Advertisement
it seems like to me it is getting into an endless loop at the setindexdata part. in taskmanager it is still running with 50% cpu usage but no reactions in the application.

incase i forgot to say so this is managed vb.net

This topic is closed to new replies.

Advertisement