Results 1 to 6 of 6

Thread: From triangle collision to mesh collision :P

  1. #1

    From triangle collision to mesh collision :P

    Hi I think i managed to translate a triangle-triangle collision routine from C to pascal, an experience that strengthened my hate to C and abuse of macros :mrgreen:

    Now, given that the procedure works (i havent set up a unit test yet), how do i pass from a tri-tri collision detection to a mesh-mesh collision detection?
    I mean, i have two mesh, but they're oriented in different and arbitrary rotation.
    Given that i could test each mesh's triangle to each of the other (a nice o(n<sup>2</sup>) algorithm :mrgreen: ), do i have to orient all the triangle before testing or is there a quicker way ?
    Any general hint ?

    Thanks
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  2. #2

    From triangle collision to mesh collision :P

    i think of now that i have to start the unpleasant work of defining my collision algos i will use the trick to break up my geometry in chunks which have a bounding box:

    [pascal]
    for i := 0 to high(chunks) do
    begin
    for i2 := 0 to high(chunks2) do
    begin
    if testbb(chunks[i].bb, chunks2[i2].bb) then
    begin
    //make two for loops here testing each tri.. break at the first intersected tris
    end;
    end;
    end;
    [/pascal]
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  3. #3

    From triangle collision to mesh collision :P

    Quote Originally Posted by JSoftware
    i think of now that i have to start the unpleasant work of defining my collision algos i will use the trick to break up my geometry in chunks which have a bounding box:
    Umm but how you calculate the boxes ? do you define them by hand ?
    Also, i have complex object (for example a ring).. do you think bb can work for them too ?


    BTW i really feel the need for a "3d theory" forum
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  4. #4

    From triangle collision to mesh collision :P

    For example with help of these functions: D3DXComputeBoundingSphere, D3DXComputeBoundingBox.
    There are only 10 types of people in this world; those who understand binary and those who don't.

  5. #5

    From triangle collision to mesh collision :P

    I?¢_~d go about it using a basic bounding sphere/box test and then a full tri-tri test on very low poly versions of the meshes. And yes, you have to multiply all vericies with their corresponding matrices.

  6. #6

    From triangle collision to mesh collision :P

    Quote Originally Posted by Clootie
    For example with help of these functions: D3DXComputeBoundingSphere, D3DXComputeBoundingBox.
    I don't use DX.
    Anyway i think that functions only gives you one sphere or one box, while i think JSoftware uses a hierarchy of boxes which far better

    A single bounding box or sphere works very bed with a torus
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •