Archived

This topic is now archived and is closed to further replies.

Limits of D3DXComputeBoundingSphere

This topic is 5151 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there an upper limit to how many vertices a mesh can have when it is passed to D3DXComputeBoundingSphere? I''m using the following code on a mesh that has a little over a billion (1,065,353,216 to be exact) vertices and my app throws a System.NullReferenceException on that line. D3DXComputeBoundingSphere(&Vertices[0], NumVerts, sizeof(D3DXVECTOR3), &root.center, &root.radius); Is there something wrong with the above code keeping in mind that: Vertices is an array of D3DXVECTOR3''s pulled from the VB NumVerts is an int using GetNumVertices() root is a struct with a center and a radius Thanks in advance for the help!

Share this post


Link to post
Share on other sites
Last time I checked, a D3DVECTOR3 was 12 bytes in size.
1,065,353,216 * 12 bytes = 12,784,238,592 bytes.
Which is approximately six times the accessible memory of your standards windows application.

In other words, your vertex buffer probably wasn''t created properly.

Also, if your Mesh object seriously returned 1,065,353,216 as a number of vertices, I would check your mesh loader.

Share this post


Link to post
Share on other sites