Path: utzoo!attcan!uunet!lll-winken!csd4.milw.wisc.edu!mailrus!purdue!decwrl!sgi!andru@rhialto.SGI.COM From: andru@rhialto.SGI.COM (Andrew Myers) Newsgroups: comp.sys.sgi Subject: Re: Mouse location input. Message-ID: <30737@sgi.SGI.COM> Date: 14 Apr 89 20:08:56 GMT References: <8904141229.AA24616@explorer.dgp.toronto.edu> Sender: daemon@sgi.SGI.COM Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 30 In article <8904141229.AA24616@explorer.dgp.toronto.edu>, juancho@dgp.toronto.edu (John Buchanan) writes: > Is there any way to determine the location of a mouse relative to > a window rather than in absolute screen coordinates? The code that I have > now looks like this. [ a valid solution to the problem ] > I cannot even imagine the thinking which led to the line drawing occuring > in window coordinates but the mouse tracking only in screen coordinates. Actually, line drawing doesn't occur in window coordinates; it occurs in world coordinates. In a pixel-oriented paradigm, the two are the same; however, SGI uses a 3D paradigm, and they are quite different. As far as getting window-relative mouse coordinates, it seems like a decision fraught with trade-offs. The only real issue is programmer ease/confusion; as you've demonstrated, it's easy enough to translate screen coordinates to window coordinates. Personally, I prefer to get the coordinates in an absolute system, because it reduces confusion for me, especially when writing multi- window programs. De gustibus non est disputandum. > > > John W. Buchanan Dynamic Graphics Project > Computer Systems Research Institute > University of Toronto > (416) 978-6619 Toronto, Ontario M5S 1A4 > Andrew Myers