Can you give me a example of how to use the Mesh.Intersect?
The model is allways on the positive side of X,Y and Z. Therefore i start with Y and Z set to zero.
So far i have this:
"extrudeValues" is just a list of bools.
public void Analyze(Device device)
{
VertexBuffer vertices = _mesh.VertexBuffer;
GraphicsStream stream = vertices.Lock(0, 0, LockFlags.None);
Vector3 min,max;
Geometry.ComputeBoundingBox(stream, _mesh.NumberVertices, _mesh.VertexFormat, out min, out max);
vertices.Unlock();
IntersectInformation[] intersectInformations;
float distanceBetween = 1.0f;
List<Layer> layers = new List<Layer>();
Vector3 rayOrigin,rayDirection;
for (float y = 0; y < max.Y; y += distanceBetween)
{
for (float z = 0; z < max.Z; z += distanceBetween)
{
rayOrigin = new Vector3(max.X + 10, y, z);
rayDirection = new Vector3(-10f, 0f, 0f);
UpdateRay(rayOrigin,device);
_mesh.Intersect(rayOrigin, rayDirection, out intersectInformations);
ExtrudeValues<bool> extrudeValues = new ExtrudeValues<bool>();
foreach (IntersectInformation intersectInformation in intersectInformations)
{
Vector3 intersectionPoint = rayOrigin + (rayDirection*intersectInformation.Dist);
}
}
}
}