Click to See Complete Forum and Search --> : capturing the mouse and ploting a graphic


Henitz
March 7th, 2005, 10:07 AM
Hello
I made something on OpenGL that capture the position of the mouse clicking de left button (that uses CPoint variable) and inserting on OpenGL command glVertex2fv (that ask for GLfloat variables).
Everything is OK, but the graphic is ploted on the wrong place.
Thanks

Elementer
March 7th, 2005, 02:16 PM
Hello,
what do you use to get the mouse position ? If you use MFC, you must create by yourself a function that convert pixel position to OGL one, if you get the mouse coord at (100,100) don't mean that in OGL viewport is also locate at (100, 100), so, you must set the ortho2d mode and create a function that perform the coords conversion, this is a way...

Regards :)

Henitz
March 11th, 2005, 07:24 AM
Hello
What are the parameters to construct the function to convert pixel position to OGL ?
Thanks