   DirectX - Creating "Abnormal" Bounding Shapes
  Well hello again guys :),I'm here again to ask about how people create bounding boxes over geometry or 2D sprites that aren't in the shape of a square/rectangle or circle. For example there is a game called "Soldat" which is full of shapes that aren't squares/rectangles or circles.So in short how is it that people create "custom" bounding boxes using DirectX?Thank you.   
  Basically you don't!For creating bounding system for complex object, it is common to use multiple bounding boxes/spheres to cover the whole body of the object.   ;  Hmm thanks for the post! But I have to say... I'm kinda dis-appointed, that method is probably very CPU intensive especially for 3D games with irregular shaped polygons/game-elements. Well, anyways that does seem like the only method so... just how would you do it? Thanks again :D!   ;  What do you need this for? Bounding boxes are normally not displayed. They are used for quick comparisons for culling and collisions. Simple shapes such as spheres and boxes are better for a quick test than a more complex object. Why do you feel you need something more complex?   ;  Well I don't really know what I'm looking for. All I know is that I need to find out how people perform collision detections on irregularly shaped objects. If you have ANY information on how to do this then please post.Thank you.   ;  Hey VirtualProgrammer,Believe it or not perfect collision is rarely needed.You were saying using spheres and boxes to match any random shape is ineficient - and it kinda is!Giving rough estimates of an object with spheres and boxes is good enough and is probably how soldat does it.Also if you are worried about having to test against all those objects all the time, you can have heirchical bounding volumesie if you want to test if a bullet hit a certain player / enemy / whatever, just test against a bounding box that encompasses the entity.  If the bullet misses the bounding box you are done and you know there was no hit.  if the bullet hits the bounding box THEN test against each arm, the head, body etc.   ;  I'm sorry... I think I explained badly :). I already understand that it can be done with spheres and squares but what I don't understand is how for example... would you tell where a bullet hit on a triangle. Alright say that you had a huge equalatural (spelling) triangle that was just floating in mid-air looking down at the player, and the player for some reason decides to shoot at that triangle which is directly above him. So now imagine the bullet the player shot going to the triangle above him. What am I supposed to do at this point? From what I can tell (after reading your post), I'm supposed to use a technique known as "heirchical bounding volumes". If this is true then could you please point me to a tutorial? 'cause I've never done this before and I would really love to get the gist of things. I'm sure you know that if you wanna make a game of any good quality... you just gotta know how to do perform some bounding techniques.Thank you.   ;  The nature of 'bounding volumes' is expressed in the term itself. It is meant to encompass an object in its entirety. If you want to perform collision at that level (polygonal) then you need to get down and dirty with some linear algebra. This, however, can be rather expensive so the idea is to test against the bounding volume or volumes first.[edit]Actually on second thought, I worded that slightly off. The basic concept of collision can work the same on both the bounding level and the polygonal (or whatever you are using) level. But it is much less expensive to test against simple shapes that are fewer in number. Hence, the reason for testing against bounding volumes first.   ;  Erm... thanks for the post but my understanding of it isn't really great :D. Your vocabulary is indeed... on another level, hehe.But seriously. Well I still don't really get it so could or anyone please post a link to a tutorial. I'm not completely hopeless though, from what you and Atrix256 have said I have got a bit of an idea of what I could do. - First of all, I would create a bounding box around the triangle (where the lower 2 corners of the triangle meet with the lower 2 corners of the bounding box and where the upper corner of the triangle meets with the centre of the 2 upper corners of the bounding box) and bullet- Then I would check to see whether or not the bullet is in the triangle's primary bounding box- If the bullet is indeed in the triangle's primary box I would then check to see if the bullet is in any of the secondary bounding boxes of the triangle (the secondary bounding boxes are essentially different regions on the triangle's body and not the empty space that the primary boudning box also covers)The problem with this method is that creating a "high resolution bounding-box system" is going to be pretty long to code (depending on how many secondary bounding boxes I want to ceate). Even though I have a plan I have no idea how to actually implement it.Thank you.   ;  no, you would actually do the triangle intersection probably, but the initial test agains the axis aligned bounding box is much faster and will tell you if you can reject a case. what you need to read about is actually how to compute whether say a ray intersects a triangle etc.google: triangle ray intersection