XNA Creators Club Online
Page 1 of 1 (8 items)
Sort Posts: Previous Next

I'm new and i need help about collisions

Last post 05-10-2008 4:28 PM by MagicBob. 7 replies.
  • 05-02-2008 1:27 PM

    I'm new and i need help about collisions

    Hello,
    I'm italian so please don't care about my grammatical errors..

    i want to collide my tank with a 3d object(like a house, a tree, something created by me) and stop its movement...how?

    and an other question:

    how can i realize something like the "TankOnAHeightmapWindows-samples" but with a terrain created by me

    instead of a heightmap?..

    i hope i was clear.. thx


  • 05-02-2008 4:23 PM In reply to

    Re: I'm new and i need help about collisions

    Typically, the game physics simulation loop is something like:

    1) detect collisions among objects
    2) handle collision and user input
    3) move objects
    4) display objects

    You can write all of that by yourself if you want -- you should do that at least once, to gain experience. Books such as "Real-time Collision Detection" by Christer Ericsson, or "Physics for Game Programmers" will help with that.

    However, if you want to cheat, there are a number of libraries that do most of the work for you. Names include "BulletX" and "JigLibX." However, you need to understand the basics of collision detection and rigid body dynamics to really understand what those libraries give you. I would recommend you read one or two books on the subject before you actually dive in and try to use a library, else you'll be pretty confused.

    Jon Watte, Direct3D MVP kW X-port 3ds Max .X exporter kW Animation source code
  • 05-03-2008 9:43 AM In reply to

    Re: I'm new and i need help about collisions

    The three basic types of 3d collision bodies:
    -BoundingBox (creates a 3D rectangular solid)
    -BoundingFrustum (creates a 3D frustum)
    -BoundingSphere (creates a 3D sphere)

    Any of these solids can be used to check collision and you can do any combination of them.  The best one to begin with is BoundingSphere because you don't have to worry about using matrices to transform it in 3d space (any sphere is the same sphere no matter how much you turn it).  Take a look at the BoundingSphere class and see if that's what you need.

    Javafox Games - because XNAFox just doesn't sound as cool.
  • 05-03-2008 12:34 PM In reply to

    Re: I'm new and i need help about collisions

    Those are not the only three bounding volumes. There are bounding capsules, convex hulls, k-DOPs, etc. Although XNA doesn't have built-in support for those volumes, you can find code on the web or in literature for how to use them.
    Jon Watte, Direct3D MVP kW X-port 3ds Max .X exporter kW Animation source code
  • 05-03-2008 1:10 PM In reply to

    Re: I'm new and i need help about collisions

    I'm sorry I didn't specify.  What I meant was that those three are the ones built-in to the XNA Framework.  Thanks for the correction.

    Javafox Games - because XNAFox just doesn't sound as cool.
  • 05-04-2008 5:50 AM In reply to

    Re: I'm new and i need help about collisions

    thanks to everybody
    I'll read the books and I'll try the libraries...
    I have to gain more experience
    again thx
  • 05-05-2008 9:30 AM In reply to

    Re: I'm new and i need help about collisions

    N Game Tutorials

    The above link leads to some collision detection and response tutorials by the N Game developers.  It's flash oriented, but they're still probably worth looking at.

    Chester Ericson's Real Time Collision Detection is a recomendation I'd second.
  • 05-10-2008 4:28 PM In reply to

    Re: I'm new and i need help about collisions

    They're absolutely worth looking at. It's what I'm using in my game, and although the code looks a little intimidating at first, it's actually really easy to implement. Although it deals in 2d, SAT tests work in 3d as well. Also, I found this tutorial here which might help you as well.
Page 1 of 1 (8 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG