Hi,
I'm trying to save out and reload a list of vector3's that contain the positions of each triangle vertex in a mesh.
I've followed the 'saving out data' threads and I have the following content processor:
[ContentProcessor]
public
class MyProcessor : ModelProcessor{
public override ModelContent Process(NodeContent input, ContentProcessorContext context)
{
ModelContent model = base.Process(input, context);
foreach (ModelMeshContent mesh in model.Meshes)
{
int nNumIndices = mesh.IndexBuffer.Count;
Vector3[] vertices = new Vector3[nNumIndices];
for (int i = 0; i < nNumIndices; i++)
{
int index = (int)mesh.IndexBuffer[i\];
VertexPositionNormalTexture vertex = (VertexPositionNormalTexture).VertexBuffer.VertexData.GetValue(index);
vertices[i\] = vertex.Position;
}
mesh.Tag = vertices;
}
return model;
}
}
This gives a casting exception when compiling a mesh. Also if they are stored as strips and not lists this will be incorrect. What would be the correct way to do this and also to access the list of vector3's in game