Jump to content
  • Advertisement

Archived

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

ms291052

Limits of D3DXComputeBoundingSphere

This topic is 5455 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
Advertisement
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
Erf, somehow that number got cubed or something... I don''t know, honestly there''s no code to do that... Must be a pointer error or something. Thanks anyway.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!