From: Bob Pendleton Newsgroups: comp.os.msdos.djgpp Subject: Re: Mouse in 3D environment Date: Wed, 25 Mar 1998 10:15:32 -0600 Organization: Southwestern Bell Technology Resouces, Inc. Lines: 25 Message-ID: <35192DA4.9B515868@tri.sbc.com> References: NNTP-Posting-Host: claymore.bb.tri.sbc.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Theuzifan wrote: > Hi all! > Did you have any idea on how to implement a mouse in a 3D environment? > I mean, I have a 3D world, I have a mouse, and I want to know at what > 3d object I've clicked... what should I do? > > Thanks in advance! > > Theuzifan Sumachingun > Tema de refexion de la semana: > - Por que se me olvidan todos los temas de reflexion que pienso en casa? The "easy" way is to define a clipping frustrun centered on a line that passes from the eye point to the point in the screen plane that the mouse pointer is currently on. Then, just(just he says :-) clip the scene to the frustrum, just like you clipped it to the viewing frustrun. The result will be a list of polygons or what ever that MIGHT be the ones you want. Then sort them and pick the one nearest to you, or farthest, or what ever rule you want to use. Bob P.