Important alert: (current site time 7/16/2013 1:05:39 AM EDT)
 

winzip icon

[[[_Need DX8.0 Help on Car Racing

Email
Submitted on: 2/5/2005 5:57:35 AM
By: Arun P {:-) 
Level: Beginner
User Rating: By 3 Users
Compatibility: VB 6.0
Views: 13205
(About the author)
 
     This is a dx 8 car racing demo, i need help on how to detect collision!!!!! plz submit a comment on how i can do this plz.......

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 3 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

2/6/2005 3:00:50 AMPeter Wilson

You need to learn “Plane Equations” and the “Dot Product” at a *minimum*, and yes this *IS* the easy way. Eg. The ground in your game is a “ground plane” and has a plane equation of ax + by +cz = d (where xyz is a point on the ground and abc is a direction pointing 90 deg away from the ground) You can use the dot-product between your car and this plane to determine which side of the plane your car is on. Now imagine your road has imaginary walls (vertical planes), perform a dot product between your car and these planes to see if the car is outside the track. Although I don’t like large one-object racetracks, you could add additional planes (walls) to your track and test against these.
(If this comment was disrespectful, please report it.)

 
2/6/2005 6:45:19 PMPeter Wilson

As an alternative, you could define points[vectors] in the middle of the road all along the track. Loop through all points to work out which one is closest to the car, then if that one is further than X distance, it's off the road. This is crude and I don't really like it, but should be easy to program. You could even tell other cars to follow these road points, to have a race.
(If this comment was disrespectful, please report it.)

 
6/18/2006 10:41:07 PMMiles Cloud

Another possible alternative is use the Windows API to create a region, then check the four corners of the car to see if it's in the correct region. That won't help with varying heights in the road, though. Anyway, good luck with your project.
(If this comment was disrespectful, please report it.)

 
12/18/2009 4:35:21 AMR.L Software

Could You Please Tell Me How To Make DirectX Objects?????
(If this comment was disrespectful, please report it.)

 
12/18/2009 5:27:28 AMR.L Software

Please Goto http://www.ink.je/reece/Amentrix/DirectX%20Area.htm For Some Tips And Objects
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.