[gameprogrammer] Re: OpenGL and mouse click location
- From: Alan Wolfe <alan.wolfe@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Wed, 6 Apr 2005 13:12:18 -0700
What you want to do is look up "Picking" mode in GL or "selection"
mode as it is also called, check this out:
http://www.lighthouse3d.com/opengl/picking/
basicly what it does is make it so you can tell which objects are
drawn under the mouse position. This is super awesome and useful
cause then you can have a super complicated 3 shape full of holes and
still be able to tell when the mouse is over it.
zooming in and out dont complicate things, as this will still tell you
whats drawn under the mouse, no matter what it's distance from the
camera is (;
On Apr 6, 2005 9:08 AM, tobias.langner@xxxxxxxxxxx
<tobias.langner@xxxxxxxxxxx> wrote:
> Hi everybody,
>
> I'm trying to write a tile-based game in OpenGL/SDL. The camera looks
> directly down on the map (no isometric view, just top-down). The
> scrolling is realised via translating the map and zooming is realised by
> changing the angle in gluPerspective. So the map remains at a fixed
> z-coordinate (10 in my case).
> The tiles are textured quads using pngs as textures.
>
> My question is: How do I determine which tile the user clicked on? Even
> an algorithm without the zoom and scrolling would be perfect since the
> rest is easy.
>
> Best regards, Tobias
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- Follow-Ups:
- [gameprogrammer] Re: OpenGL and mouse click location
- From: Frank Herrera
- References:
- [gameprogrammer] OpenGL and mouse click location
- From: tobias . langner
Other related posts:
- » [gameprogrammer] OpenGL and mouse click location
- » [gameprogrammer] OpenGL and mouse click location
- » [gameprogrammer] Re: OpenGL and mouse click location
- » [gameprogrammer] Re: OpenGL and mouse click location
- » [gameprogrammer] Re: OpenGL and mouse click location
- » [gameprogrammer] Re: OpenGL and mouse click location
- » [gameprogrammer] Re: OpenGL and mouse click location
- [gameprogrammer] Re: OpenGL and mouse click location
- From: Frank Herrera
- [gameprogrammer] OpenGL and mouse click location
- From: tobias . langner