Jump to content


Photo

Tritricollisions - 3d Polygon Collision Detection


  • Please log in to reply
4 replies to this topic

#1 Hach-Que

Hach-Que

    RoketGames Admin

  • New Member
  • 1490 posts

Posted 28 January 2007 - 03:00 AM

TriTriCollisions

This DLL detects collisions between 2 3D Triangles. More information can be found in README.txt and the Game Maker 6 file. Full source included.

Download Page

Credit is not required but would be nice.

* This DLL has been superseded by hanson's 3d Collisions Dll. Please see http://gmc.yoyogames...howtopic=329495. *

Edited by Hach-Que, 10 January 2008 - 01:28 AM.

  • 0

I don't visit these forums (and I haven't for quite some time). You can

see my latest community projects at the Redpoint Blog.


I never thought I'd see myself writing the above.. :(


#2 RabbidMickeyMouse

RabbidMickeyMouse

    GMC Member

  • New Member
  • 241 posts

Posted 28 January 2007 - 08:20 AM

Interesting dll. For curiosity, I wanted to see how fast it was, and ran it under the following code...

begin_t = date_current_time();
repeat 1000
{
 p11 = TriTriCollisions_Point_Define(0,0,2);
 p12 = TriTriCollisions_Point_Define(2,0,0);
 p13 = TriTriCollisions_Point_Define(0,2,0);
 p21 = TriTriCollisions_Point_Define(0,0,0);
 p22 = TriTriCollisions_Point_Define(2,0,2);
 p23 = TriTriCollisions_Point_Define(0,2,2);
}
end_t = date_current_time();

time_diff = string(date_second_span(begin_t,end_t));
show_message(time_diff+"seconds, "+string(1000/real(time_diff))+" operations per second");

I got on average 1.10 seconds, and 909.09 operations (I would imagine others would get faster results, as my computer is practically ancient by today's standards).

I also noticed that as the workload increased, the number of operation per second decreased. Here is what I found...
Repeat = Seconds = Operations Per Second
 1000  = 1.10    = 909.09
 2000  = 2.86    = 699.30
 3000  = 5.49    = 546.45
 4000  = 8.84    = 452.49
 5000  = 13.62   = 367.11

  • 0

#3 Hach-Que

Hach-Que

    RoketGames Admin

  • New Member
  • 1490 posts

Posted 28 January 2007 - 08:50 AM

Yeah. This is because TriTriCollisions_Define_Point() creates a ds_list. So you need to remove the list afterwards. I'm currently working on 2 more GML functions which allow you to change the triangles without using ds_lists.

I'm also thinking of adding a function in the DLL to test collision between a 4-point polygon, to speed up the checking of 2 triangles.

Edited by Hach-Que, 28 January 2007 - 08:52 AM.

  • 0

I don't visit these forums (and I haven't for quite some time). You can

see my latest community projects at the Redpoint Blog.


I never thought I'd see myself writing the above.. :(


#4 WarriorArtiste

WarriorArtiste

    3d Creator

  • New Member
  • 1032 posts

Posted 09 January 2008 - 12:00 AM

Yeah.  This is because TriTriCollisions_Define_Point() creates a ds_list.  So you need to remove the list afterwards.  I'm currently working on 2 more GML functions which allow you to change the triangles without using ds_lists.

I'm also thinking of adding a function in the DLL to test collision between a 4-point polygon, to speed up the checking of 2 triangles.

<{POST_SNAPBACK}>


Is it possible to modify this into a TriPointCollisions DLL (For extra speed)? And, if possible, could you also release a TriSphereCollisions DLL?

Edited by WarriorArtiste, 09 January 2008 - 12:22 AM.

  • 0
Ultimate 3D 2.1 April 2, 2008!

-33% of the population are Zoogles, 34% of the population are Yoodles, and 100-(34+33)% of the population are noodles. If you put this in your signature, I'm alright with that, if not, that's fine too.

#5 Hach-Que

Hach-Que

    RoketGames Admin

  • New Member
  • 1490 posts

Posted 09 January 2008 - 08:20 AM

The last post by me in this topic was at the start of last year... Unfortunately I have bigger fish to fry, and I'm sure that there is an alternative to this DLL (I've seen one somewhere).

However, the source code is there, so you are free to modify it to suit your needs (you'll need Dev-Cpp).

* This DLL has been superseded by hanson's 3d Collisions Dll. Please see http://gmc.yoyogames...howtopic=329495. *

Edited by Hach-Que, 10 January 2008 - 01:26 AM.

  • 0

I don't visit these forums (and I haven't for quite some time). You can

see my latest community projects at the Redpoint Blog.


I never thought I'd see myself writing the above.. :(