PDA

View Full Version : Problem with form pixels and open gl



papageorge
10-18-2009, 07:08 PM
Hello,

I develop an application in visual basic.net that contains both vb controls and opengl. The problem is that the visual basic in forms uses pixels and opengl does not. I tried to make the conversion :

x = -1+(2/Form1.width)*x_coord_in_pixels
y = 1 - +(2/Form1.height)*y_coord_in_pixels

Gl.glRectf(x, y, x + 0.25, y + 0.25)

but i see that the coordinates in my form are still different from theese in opengl. It is a litle bit confusing but i hope you understand. If you don't please tell me and I will explain more

Thank you

rakesh_thp
10-19-2009, 04:45 AM
Would u explain what exactly are you trying to do..?? I mean why are u converting it..?? what is the problem u r trying to solve.??

papageorge
10-19-2009, 02:47 PM
Well, my form contains both opengl components that i have created and .net controls. The problem is that I control the object's position dynamicaly, so when I say that the .net button is in position (100,200) the opengl component (for example a rectangle) should have the SAME position.

papageorge
10-19-2009, 03:00 PM
holly god! It was the border of the form! I should disable it...
Thanks anyway