[gameprogrammer] Re: OpenGL and mouse click location
- From: Stephane Marchesin <stephane.marchesin@xxxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Wed, 06 Apr 2005 22:42:37 +0200
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.
>
I'll add in my answer as well :) In simple cases such as yours, it's
sufficient to use gluUnProject()
Stephane
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- Follow-Ups:
- [gameprogrammer] Re: OpenGL and mouse click location
- From: iso8859-1
- 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: iso8859-1
- [gameprogrammer] OpenGL and mouse click location
- From: tobias . langner