I'm having trouble using the vertexdata commands. I keep getting an error telling me I need to create a new reference to the object, but I don't see any constructor for vertexdata, so I assume it works on whatever I have locked. Here is my code, if anyone can help me out, it would be greatly appreciated.
DarkGDK.Basic3D.Object3D myObject;
DarkGDK.Basic3D.Mesh myMesh;
myObject = new DarkGDK.Basic3D.Object3D("corrected2.x");
myMesh = new DarkGDK.Basic3D.Mesh(myObject);
DarkGDK.Basic3D.VertexData.LockForMesh(myMesh);
//modify mesh
for (var y = 0; y < 4799; y++)
{
DarkGDK.Basic3D.VertexData.SetPosition(y, DarkGDK.Basic3D.VertexData.GetPositionX(y), depthValues[y], DarkGDK.Basic3D.VertexData.GetPositionZ(y));
}
DarkGDK.Basic3D.VertexData.Unlock();
ok, I got it figured out. After reading almost every post on this forum, I found out you have to create the new object from mesh with a texture, and, I was passing in my depth values wrong. Anyway, I have realtime mesh deforming with the Kinect working now on an 80x60 grid. It keeps up at about 40 fps (which is good because Kinect returns at 30fps), but, generateobjectnormals knocks it down to about 19 fps. Still not bad, but, I think I'll have to start looking at interop.
here is a sneek peek video of the Kinect deforming an 80x60 mesh. Still needs some work, like I have to port my DBPro code to figure acurate x,z spacing. But still, this is the nuts and bolts.
http://www.youtube.com/watch?v=yCKwO-DvwHQ