m = Mesh.FromFile(My.Application.Info.DirectoryPath & "\Data\Models\Box.X", MeshFlags.Managed, DEV) Using vb As VertexBuffer = m.VertexBuffer Dim vertexData As GraphicsStream = vb.Lock(0, 0, LockFlags.None) objectRadius = Geometry.ComputeBoundingSphere(vertexData, m.NumberVertices, m.VertexFormat, objectCenter) vb.Unlock() End Using
Now the problem is that I'm getting some weird results as center and radius:
objectCenter.X : -944.5798 objectCenter.Y : 0 objectCenter.Z : 944.5798 objectRadius : 0.007336923
although box's width, height and length are about 50, and box's position is 0. What could be going wrong here?