[gameprogrammer] Re: screen to world coord conversion in OpenGL

  • From: "Alan Wolfe" <alan.wolfe@xxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Mon, 17 Mar 2008 09:12:43 -0700

If this helps, another way to do it is think of it like this.

When you click on a point with the mouse, it covers up 1 pixel.  What
is under the mouse could be near, or it could be far.

So, what you do is cast a ray that follows that path from where you
clicked the mouse into the scene, and find the closest intersection of
the ray to an object that you care about.


On Mon, Mar 17, 2008 at 7:33 AM, richard sabbarton
<richard.sabbarton@xxxxxxxxx> wrote:
> Hi There,
>
> Lookup gluUnProject() in the OpenGL documentation.  It should do what you 
> need.
>
> Richard
>
>
> On 17/03/2008, Luo Hei <luo_hei@xxxxxxxx> wrote:
> > Does somebody has a good and easy to underestand article about the
> > subject? Im trying to implement a basic tile-base like enginein 3d but I
> > cant figure a way to convert mouse clicks to world coordinates.
> >
> > --
> > What one fool can do, another can.
> > Silvanus P. Thompson
> >
> >
> >
> > ______________________________________________
> > LLama Gratis a cualquier PC del Mundo.
> > Llamadas a fijos y móviles desde 1 céntimo por minuto.
> > http://es.voice.yahoo.com
> >
> >
> > ---------------------
> > To unsubscribe go to http://gameprogrammer.com/mailinglist.html
> >
> >
> >
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>
>

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: