Original Post
I wanted to create a mesh from the code...and to put my vertexBuffer,IndexBuffer inside in order to create the normals for the each vertex in my buffer.(using the computeNormals of the mesh) I don't know what's wrong here but i get an overflow error,.. The...number of faces parameter should be: vertexNR/3 no?,..hmmm what could be?
Dim auxMesh As Mesh = Nothing
auxMesh = New Mesh(HeightMapCls.BmpWidth * HeightMapCls.BmpHeight / 3, HeightMapCls.BmpWidth * HeightMapCls.BmpHeight, MeshFlags.SystemMemory, MyVertexType.Format, device)
auxMesh.VertexBuffer.SetData(HeightMapCls.verts, 0, 0)
auxMesh.IndexBuffer.SetData(HeightMapCls.indexArray, 0, 0)
auxMesh.ComputeNormals()
VertexCls.vertexBuffer = auxMesh.VertexBuffer
VertexCls.indexBuffer = auxMesh.IndexBuffer
device.SetStreamSource(0, VertexCls.vertexBuffer, 0)
device.Indices = VertexCls.indexBuffer