3 dimensional math question here...
Okay, when I was much younger, I made a cute airplane dog fighting game on my Commodore 64.
Think super old school.
Now, in this game, obviously I was very limited in some of the physics involved.
Both planes could only fly in 8 directions. (Up, Down, Left, Right, Up Left, Up Right, Down Left, Down Right)
Instead of showing actual ammunition being fired between the two planes, which made the game run super chunky (I programmed it in BASIC), I opted to generate a simple formula.
I found that if you subtracted the two memory locations on the screen (1024 - 2048 I think) of both the planes and then divided it by the plane's direction (-39, -40, -41, -1, 1, 39, 40, 41).... If that result was a whole number, this would be that the one plane had the other directly in it's site.
Obviously if the plane was going horizontal (-1 or 1), it would always produce a whole number in my equation so I had to tweak my formula just a titch.
Sorry for the ramble.
Anyway. Nutshell time.
Take the two memory locations of both planes and subtract them, divide that by the direction of one of the planes, if the number is whole (with a horizontal exception), you can calculate if the other plane is in direct fire with the first one.
With that being said, could such a formula be generated in 3 dimensional space?
So say you have an object somewhere.
You have another object someplace else pointing in a certain direction.
Can you create a formula to see if that second object's direction is in perfectly direct site to the other?
If so, what are all of the number's or variables required for this?
If possible, could you provide a simple math example?
Thanks!
I super wuvs this thread!
