?

Log in

No account? Create an account

Previous Entry | Next Entry

Working on my game, attempting collision detection--and I forgot how to calculate the distance between two euclidean points. WTF? I knew a sqrt was involved, but. Damn! DISTANCE, folks!

Okay, making progress...

Then I almost freaked out at finding the midpoint. Seriously, not a proud day in the Kaolin life. But I got that with just a short bit of panic and a shake of the head. Now pounding my skull on the nearly-as-obvious disk/sphere collision. I have an intuition for how to do that that feels fairly inspired, and I just need to figure out exactly which variables to tweak to get what I need.

Comments

( 4 comments — Leave a comment )
narnianspoonful
Feb. 13th, 2005 01:08 pm (UTC)
dude
((x2-x1)^2 + (y2-y1)^2)^.5 = distance

midpoint:
((x1+x2)/2) , (y1+y2)/2))
kaolinfire
Feb. 13th, 2005 01:23 pm (UTC)
Re: dude
well, 3 dimensions; but yeah. I'm not saying I was stuck on it, just that it wasn't at the tip of my mind already.

Now I'm back to wondering which vector I've screwed up s.t. the asteroids don't explode the right directions--or if it's a programming thing, and I'm overwriting my change somehow somewhere. :/

Moving forward, slowly slowly.

Next game is going to be so much easier. :)
narnianspoonful
Feb. 13th, 2005 03:38 pm (UTC)
Re: dude
3d is same in principle. the hyp in question has two hyp legs
nibot
Feb. 13th, 2005 09:55 pm (UTC)
Re: dude
midpoint of x and y: (x + y)/2

magnitude: sqrt(x dot x)

(-:
( 4 comments — Leave a comment )

Latest Month

February 2016
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
2829     

Tags

Page Summary

Powered by LiveJournal.com
Designed by chasethestars