Archived

This topic is now archived and is closed to further replies.

AHHHHH!!!!!!!!!!!!

This topic is 5897 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

AHHHHHHHHHHHHH!!!!!!!!!!! I have spent the last 3 weeks getting the collision detection for my game to work without any luck. After numerous posts for help and getting tips like use bounding boxes etc, I am just going to ask, "CAN SOMEONE WRITE THE COLLISION DETECTION CODE FOR ME". I don''t want ways I can do collision detection, I want code, and not packages like ColDet. I am very stressed at the moment.:-O Download my source at - http://home.iprimus.com.au/laser1/car.zip. Its in DirectX and VisualC++. P.S. search for my other posts using my username for more info

Share this post


Link to post
Share on other sites
Common... get serious.. Nobobdy will hack through your code, implement something and send it back.. har har.. *LOL*. Get some good Hightschool Maths books and figure it out yourself..
cya,
Phil


Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states

Share this post


Link to post
Share on other sites
The other replies are a bit brutal, but they are correct. It is discourteous to cross-post a question. And few people are going to donate complete solutions to your problem---maybe just bits and pieces for specific technical questions asked. I recommend the use of web searches---even gamedev.net forum archive searches---before posting a new question. Collision detection has been discussed many, many, many, many times before in many, many, many places. This approach will save time, bandwidth, and forum storage space.

That said, I offer some pointers to web resources with source code available:

Look at the University of North Carolina at Chapel Hill website for some software for collision detection. No promises that it is fast or robust or easy to use or even works on a platform other than Unix, but at least it is some code.

http://www.cs.unc.edu/~geom/collide/

Some of their s/w is downloadable and some you have to request permission to use.

You might also look on the web for the GJK algorithm. There should be source code out there. Here are examples:

http://www.win.tue.nl/~gino/solid/
http://users.comlab.ox.ac.uk/stephen.cameron/distances.html

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Share this post


Link to post
Share on other sites
Here's a very good tutorial. There is also a demo with source code, try looking at it and it with help you alot.

Telemacho's Tutorial: http://www.peroxide.dk/tutorials/tut10/pxdtut10.html

Hope it will help.

Another thing, i noticed that your car only move on the x and z axis, is it possible to do 2d collision detection from top view?



Edited by - Strange Monkey on October 22, 2001 7:04:03 PM

Share this post


Link to post
Share on other sites
I was trying to compile your program so that I could have a look at it to see if I could help, but I seem to be missing function sqrtf in one of my include files (I assume it should be in math.h, but it may be elsewhere). Any idea where this function is defined, so I can get an update to the relevant include file.

Share this post


Link to post
Share on other sites
Unfortunately I''m not!

I''m using the free Borland command line compiler, which means that if you want to find something, you have to do it yourself!

Thanks for the suggestion though.

Share this post


Link to post
Share on other sites
Ok, solved the sqrtf problem (sqrtf is a non-standard function and so Borland don''t support it - fortunately a quick #define sqrtf (float)sqrt does the trick).

Next problem - you don''t seem to have said anywhere which libraries your source code needs to link to. Is there a standard DX library (I''ve never used directX before)?

Share this post


Link to post
Share on other sites
Right, I''ve gotten it to compile okay now (had to find Borland compatible libs first) - quick question, are the colours supposed to be really messed up (i.e. black block & green background)?

Share this post


Link to post
Share on other sites
How accurate do you need your collisions to be? A simple bounding box would probably be best, but I don''t know how to get the geometry of the car from DirectX. If you can get me the individual planes for each object, I can write you some collision detection code. I recommend you write a getGeometry method that returns an array of Planes, each of which is an array of the four corner points. Might be an idea to also write a numberOfPlanes method that will return the number of planes that make up the object, simply to make parsing the planes easier.

One point - I found your code quite difficult to read. A few more comments would be appreciated! (As well as some indication of which functions are in which files).

Share this post


Link to post
Share on other sites
quote:
Original post by flashlaser
Ok, I''ve got the collision detection working, YAY!!!!!!!!!. Now I just need to figure out a way to get my collision detection to handle gravity.


Congratulations that you got it working. But what does gravity have to do with collision detection?


Dirk =[Scarab]= Gerrits

Share this post


Link to post
Share on other sites