   Need help with OpenGL transformations
  Hello,I am very new to OpenGL and 3D graphics in general and am a bit stuck at how to achieve the following.Currently, I have a simple OpenGL drawing routine that draws a aimple 2D grid as follows. The code is inside a DLL.extern "C" __declspec(dllexport) BOOL draw_gl(HDC *hdc,  HGLRC *hglrc){  if (hdc && hglrc) {   wglMakeCurrent(*hdc, *hglrc); glClearColor(0.0f, 0.0f, 0.0f, 0.0f);glClear(GL_COLOR_BUFFER_BIT);glPushMatrix();   glBegin(GL_LINES);   glColor3f(1.0f, 0.0f, 0.0f);   const float delta = 0.1f;   for (float i = -1.0f; i<= 1.0f; i+= delta) {  glVertex2f( 1.0f, i);  glVertex2f(-1.0f, i);   }   for (float i = -1.0f; i<= 1.0f; i+= delta){  glVertex2f(i,  1.0f);  glVertex2f(i, -1.0f);   } glEnd();   glPopMatrix(); return TRUE;    }    return FALSE;}The code works fine and I see a 2D grid fill the screen.Now, I want to extend the function as follows:extern "C" __declspec(dllexport) BOOL draw_gl(HDC *hdc,  HGLRC *hglrc, float *affine)where affine points to a 9 element array that represents a homogeneous affine transformation.Now, what I want is to apply this transformation to my grid. My default the grid fills the whole screen. Now say for example, my transformation is a simple translation, then I want the grid to be translated. So when I translate the grid (say to the right), then the grid starts drawing from the new position rather than the absolute screen left...Does that make sense? Same with the scaling...I guess the delta value should change with scaling...So, considering the drawing code above, is there a way to apply a 3x3 affine transformation to my grid vertices using OpenGL(I guess the z component can be set to 0).I hope the question is sensible. I am sorry if it is a very basic one but I am quite new to this and it took me hours just to write this simple rendering code!Many thanks,xarg   
  OpenGL uses 4x4 transformation matrices, you need to convert your 3x3 into a 4x4 matrix. You can load it into the correct matrix stac with glLoadMatrixfv   ;  Thanks for that.I tried a simple test as follows:extern "C" __declspec(dllexport) BOOL draw_gl(HDC *hdc,  HGLRC *hglrc){  if (hdc && hglrc) {   float test[16] = {0.0f};   test[0] = 1.0f;   test[5] = 1.0f;   test[10] = 1.0f;   test[12] = -1.0f;   test[13] = -1.0f;   test[14] = 0.0f;   test[15] = 1.0f;   wglMakeCurrent(*hdc, *hglrc); glClearColor(0.0f, 0.0f, 0.0f, 0.0f);   glClear(GL_COLOR_BUFFER_BIT);   glLoadMatrixf(test);   glPushMatrix();   glBegin(GL_LINES);   glColor3f(1.0f, 0.0f, 0.0f);   const float delta = 0.1f;   const float limit    for (float i = -1.0f; i<= 1.0f; i+= delta) {  glVertex2f( 1.0f, i);  glVertex2f(-1.0f, i);   }   for (float i = -1.0f; i<= 1.0f; i+= delta){  glVertex2f(i,  1.0f);  glVertex2f(i, -1.0f);   } glEnd();   glPopMatrix(); return TRUE;    }    return FALSE;}This seems to work as expected. There is just one last bit. My transformation matrix is in GDI+ screen pixel coordinates. Is there a simple way to transform this to the OpenGL coordinates???Thanks again for your help.xarg   