Click to See Complete Forum and Search --> : converting pixel position to Open GL


Henitz
March 11th, 2005, 07:29 AM
Hello
Where I can enconter the parameters to create a function to convert pixel position to OpenGL.
Thanks

Elementer
March 11th, 2005, 02:30 PM
Hello,
what do you mean ? You can also use MFC, but during mouse click, OGL must be in ortho 2d mode, thus if you get mouse position at (100, 100) you can draw a quad at (100, 100) but remember that OGL have the origin (0, 0) at lower left corner, where MFC window coords starts at upper left one. The x coord is the same, but y one is different, for instance, if you get MFC y at 150, it mean for OGL this:

ogl_y = window_height - 150

Remeber to get the correct client rect area before doing this...

Regards :)

Henitz
March 12th, 2005, 12:06 PM
Hello
I made the function but the other things:
1)ortho2d Mode
2) Correct client area
I donīt know if correct setted
I attached the code, so you can see whatīs happening.

Another thing, on the begginig of the project I used with the base class RichEditView, because I wanted to create a document to be printed.
When I used WM_Paint the VC warned to not use.
I can use another function, or worst I canīt use RichEditView with OGL.
Thanks
Obrigado

Elementer
March 12th, 2005, 06:05 PM
Hello,
I reply you with private message.
Bye