Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!psuvax1!rutgers!cbmvax!cbmehq!cbmger!peterk From: peterk@cbmger.UUCP (Peter Kittel GERMANY) Newsgroups: comp.sys.amiga.programmer Subject: Re: Clicking on irregular shapes? Message-ID: <1079@cbmger.UUCP> Date: 8 Apr 91 08:10:55 GMT References: <1991Apr05.104141.2118@cs.ruu.nl> <27867@neptune.inf.ethz.ch> Reply-To: peterk@cbmger.UUCP (Peter Kittel GERMANY) Organization: Commodore Bueromaschinen GmbH, West Germany Lines: 29 (Sorry, deleted the originator's name.) > [an algorithm for determining whether a point's inside a polygon] > >I am currently writing a game that needs this (and probably will never be >finished :^). Now what about this: > /\ > / \ /\ > / O \ / \ X > / \/ ___\ > /_______ / > \/ I always have moot feelings with such analytical algorithms. Often you have to compare for equality of real numbers, which is normally a NO-NO. You would have to convert coordinates to integers only to do this algorithm on them. Look for another example at this shape, would it be processed correctly? /\ / \ /\ / O \_____/ \ /_______________\ The O is thought to be on the same y coordinate as the horiz. line. -- Best regards, Dr. Peter Kittel // E-Mail to \\ Only my personal opinions... Commodore Frankfurt, Germany \X/ {uunet|pyramid|rutgers}!cbmvax!cbmger!peterk