1. Collision detection?
- Posted by Joshua Milligan <silverlaser at HOTMAIL.COM> Apr 09, 1997
- 821 views
Sorry if this sounds like a stupid question, but I was just wondering what collision detection was. If anyone knows, I'd like some information on the subject. I was also wondering if there was a way in Euphoria of displaying images on the screen (display_image()) that would merge images and backgrounds (like Qbasic's XOR or AND). Thanks in advance. __ ___ __ ___ ___ /_/| /__/\ /_/| /__/\ /__/| | || | \\ | || | \\ / || | || | |\ \\ | || | |\ \\ / || | || | ||\ \\ | || | ||\ \/ /| || _ | || | || \ \\ | || | || \ //| || /_/\__| || | || \ \\| || | || \// | || \ \/__/ // | || \ \| || | || | || \_____// |_|/ \___|| |_|/ |__|/ Joshua N. Milligan silverlaser at HoTMail.com --------------------------------------------------------- Get Your *Web-Based* Free Email at http://www.hotmail.com ---------------------------------------------------------
2. Re: Collision detection?
- Posted by Michael Packard <lgp at EXO.COM> Apr 09, 1997
- 827 views
On Wed, 9 Apr 1997, Joshua Milligan wrote: > > Sorry if this sounds like a stupid question, but I was just wondering what > collision detection was. If anyone knows, I'd like some information on the > subject. Collision detection is DETECTING if things are COLLIDING. A collision is when parts of two or more objects try to occupying the same space at the same time, like when two cars hit each other, or when a ball its a wall. In computer graphics, it's when the Area Of Interest of image 1 overlaps the Area of Interest of image 2 on the screen. If you don't want that to happen, say you want to explode your ship when it hits an oid, you need to do some sort of collision detection every once in awhile to see if they are colliding, then do something about it. I say Area of Interest (AoI) of the images, since usually the image is bigger than the part your interested in colliding with something. You animate with rectangular images, but your ship, say doesn't completely fill the rectangle, so you pick a smaller AoI that closer corresponds to your ship. Sometimes you want to have part of your objects overlap before you blow them up. To actually check for a collision, an easy way is to check the upper left and lower right x,y coordinates of the AoI of object 1 and see either of them are inside the AoI of object 2, then do the same with object 2. Michael Packard Lord Generic Productions lgp at exo.com http://exo.com/~lgp A Crash Course in Game Design and Production http://exo.com/~lgp/euphoria