Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


XNA Bounding Boxes


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 Xardov   Members   -  Reputation: 112

Like
0Likes
Like

Posted 11 February 2012 - 08:42 PM

So I'm following the 3D tutorial in this book:
http://www.amazon.com/Learning-XNA-4-0-Development-Windows/dp/1449394620/ref=sr_1_1?ie=UTF8&qid=1328935412&sr=8-1.

But for collision, the book uses BoundingSpheres instead of BoundingBoxes. I've done extensive Googling, but the tutorials i've found seem to overcomplicate the issue, because most of them try to extend the Content Pipeline, which I do not want to do. I would really like to know how to use BoundingBoxes, so if someone could kinda show me how? If you guys really have the time, I would also really appreciate it if you would actually implement the BoundingBoxes in the sample game.... because I kinda learn best by example. But just showing me the steps is great too.


http://dl.dropbox.com/u/13907487/3D%20Game.zip


But yeah, I hope I don't sound like an annoying noob who's begging for help, but I really want to learn to use BoundingBoxes. Thanks!


P.S. Also, yeah I know I posted a topic about this before, but that was in the wrong section.


Sponsor:

#2 blackbook   Members   -  Reputation: 110

Like
0Likes
Like

Posted 12 February 2012 - 12:19 AM

Sorry I dont understand I gave you enough information in your last thread on the subject that you should have been able to do some research and then implement a bounding box.

Which particular aspect of creating a BB do you not understand?

http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.boundingbox.boundingbox.aspx

A BB only needs two Vector3's for defining where and how large the box will be.

#3 Xardov   Members   -  Reputation: 112

Like
0Likes
Like

Posted 12 February 2012 - 12:49 AM

Well, I'm having difficulty comprehending where the min and max positions should be, since I have no way to actually measure the height and width of the model.

#4 phil_t   Crossbones+   -  Reputation: 3945

Like
0Likes
Like

Posted 13 February 2012 - 04:16 AM

Well, I'm having difficulty comprehending where the min and max positions should be, since I have no way to actually measure the height and width of the model.


Well obviously you're going to need the positions of the model's vertices in order to determine the min/max positions. Without that information the best you could do is generate a bounding box that surrounds the bounding sphere of the model - but that will generally be too large (maybe it's good enough for your purposes though).

It's difficult to get at the Model class's vertex positions at runtime. That's why most samples you see involve extending the content pipeline - because at that stage you have access to the vertex positions.

#5 Xardov   Members   -  Reputation: 112

Like
0Likes
Like

Posted 13 February 2012 - 05:53 AM


Well, I'm having difficulty comprehending where the min and max positions should be, since I have no way to actually measure the height and width of the model.


Well obviously you're going to need the positions of the model's vertices in order to determine the min/max positions. Without that information the best you could do is generate a bounding box that surrounds the bounding sphere of the model - but that will generally be too large (maybe it's good enough for your purposes though).

It's difficult to get at the Model class's vertex positions at runtime. That's why most samples you see involve extending the content pipeline - because at that stage you have access to the vertex positions.


Oh, I see. What if my model didn't move at all? Say for example, a cube that is simply placed into the world, and does not move. Would it still be hard to create bounding boxes then?

#6 phil_t   Crossbones+   -  Reputation: 3945

Like
0Likes
Like

Posted 13 February 2012 - 02:19 PM

Your problem is simple: To create the bounding box you need to know the positions of the vertices. If you don't know those, then you're out of luck.

#7 Xardov   Members   -  Reputation: 112

Like
0Likes
Like

Posted 13 February 2012 - 05:23 PM

Mm-hmm... Thanks then, I guess i'll just have to extend the content pipeline.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS