Hmm...actually I haven't tried to hard but it was tough finding a good
online description of how to calculate a cross product, and then
multiply it...
On 7/22/05, Aaron <stella-receiver@xxxxxxxxxxxxxxxxx> wrote:
> Kirk Israel said:
> > So I'm trying to get something a bit like combat biplanes. And I've
> > been musing on this problem: how would I get, say, an onscreen heat
> > seeking missile to work?
> >
> > Basically, it has to know if it should turn left or right to get to the
> > target.
>
> Hey, I have something useful to say for once! :)
>
> Take the missile velocity, that's one vector. Then take the distance from
> the missile to its target, that's another vector. Take their cross
> product, i.e. y1*x2 - y2*x1. If it's negative, you turn one way, if it's
> positive you turn the other (I forget which is which, but it should be
> easy to figure out). I did this in a Palm game once and it looks cool...
>
> -Aaron
>
> Archives (includes files) at http://www.biglist.com/lists/stella/archives/
> Unsub & more at http://stella.biglist.com
>
>
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://stella.biglist.com