|
-
Sep 8th, 2000, 01:38 AM
#1
Thread Starter
Junior Member
I need to know the fastest and most optimized way to detect 3D objects in DirectX IM. Are there any good tutorials around to explicitly learn about collision detection? If so please tell me. If not and you do know how to detect collisions please tell me also. Thank you.
-
Sep 8th, 2000, 06:47 PM
#2
ok,
ok,
well, i don't know about the first one, and i don't know if this is the answer youre looking for on the second one, but i detect collisions using this code:
(i don't know how to make that code thing, please tell me!)
Public Sub LaserHit()
If z = 1 Then GoTo 12
If Laser.Left >= guy.Left And Laser.Left <= guy.Left + guy.Width And Laser.Top <= guy.Top + guy.Height And Laser.Top > guy.Top Then
MsgBox "you hit him"
z = z + 1
12
End If
End Sub
thats the basic code i use, hope thats what youre looking for, but if anyone else out there knows, and i know you do!, how to change the picture each time the laser hits. up to four times? thanks
-
Sep 9th, 2000, 06:53 PM
#3
Hyperactive Member
but he needs 3d collision detection, which is harder..
btw, your collision detection thing could be better by saying
if Laser.Left < guy.left Or laser.left > guy.left + guy.width ..etc Then
'NOT HIT
else
'HIT
endif
using Or means that if an early check fails (say if laser.left is bigger than guy.left) then the other parts of the If arent checked, making it faster. not much, but a little
buzzwords are the language of fools
-
Sep 9th, 2000, 07:58 PM
#4
Frenzied Member
Actually I'm pretty sure that both logical statements are checked every time in VB. In C and some other languages it's like you say Kennny, but VB does it the long and crap way.
Harry.
"From one thing, know ten thousand things."
-
Sep 10th, 2000, 04:04 AM
#5
Hyperactive Member
im pretty sure i read that VB can do shortcuts..i know its language specific, but I thought VB supported it. anyone know 4 sure?
buzzwords are the language of fools
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
|