मुझे लगता है कि मैं एक BoundingBox (बस XNA4.0 में) की तरह बनाने हूँ ऐसा करने के लिए Silverlight 5 में 3 डी मॉडल टक्कर प्राप्त करने के लिए कोशिश कर रहा हूँ:सिल्वरलाइट 5 और VertexBuffer.GetData()
मैं एक ही सवाल देखा VertexBuffer.GetData() and Silverlight 5 इस लिंक में लेकिन कोई जवाब नहीं मिला।
public BoundingBox GetBoundingBoxFromModel(Model model)
{
BoundingBox boundingBox = new BoundingBox();
foreach (ModelMeshPart part in model.Meshes[0].MeshParts)
{
VertexPositionNormalTexture[] vertices = new VertexPositionNormalTexture[part.NumVertices];
Vector3[] vertexs = new Vector3[vertices.Length];
part.VertexBuffer.GetData<VertexPositionNormalTexture>(vertices);
for (int index = 0; index < vertexs.Length; index++)
{
vertexs[index] = vertices[index].Position;
}
boundingBox = BoundingBox.CreateMerged(boundingBox, BoundingBox.CreateFromPoints(vertexs));
}
return boundingBox;
}