|
-
Aug 20th, 2000, 10:50 AM
#1
Thread Starter
Frenzied Member
Do any of you have any source of how to do collision detection in Visual Basic using Direct X 7.0 ?
-
Aug 20th, 2000, 10:54 AM
#2
Monday Morning Lunatic
Well, there are more complicated methods, but the sphere-boundary one is useful enough. First, create a sphere large enough to hold the whole object, then compare the radii of that and another object's bounding sphere. If they collide, either claim a collision there, or move onto a slower but more accurate method, such as polygon piercing. I don't know too much, but it's a possibility.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 20th, 2000, 12:32 PM
#3
Frenzied Member
To do that, would you identify the vector between the two sphere's centres and then check the length to see if it's less than the sum of the two radii? Or is there an easier method?
This isn't something I know about so I'm just interested.
Harry.
"From one thing, know ten thousand things."
-
Aug 20th, 2000, 12:50 PM
#4
Thread Starter
Frenzied Member
Ok,
anyone else have some code demos on how to do it. I will have a look on PSC for some stuff too.
-
Aug 20th, 2000, 03:10 PM
#5
transcendental analytic
That's exactly as Harry said...
Code:
If sqr((A.X-B.X)^2+(A.Y-B.Y)^2+(A.Z-B.Z)^2)<ARadii+BRadii then ... (check for collisions with vertexes inside the other object)
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|