Displaying pixel grids


   I am developing project based on PCB designing using OpenGL Graphics.  In my viewport, i need to display grid points on each unit. I displayed the grid points for every unit by getting the viewport extents.  But while panning the portion where we displayed the grid points are as such but in the remaining portions the screen is blank. Please help me in developing the code for displaying the grid points in every unit even while panning.  And the pixel grids should disappear after some particular amount of "Zooming In & Zooming Out" the diagram. We need to display points and not the grid lines.  (Note: The display of grids have to same as that of the grid display in CAM350 version 7.0.)

Thanking You.

I guess you are using orthographic projection ?

I am not sure I understand the problem, do you have problems not having gridpoints rendered all over the viewport when you pan ?

How do you pan ?, glTranslate or what ?



We are using Orthographic as well as Perspective

Projection. But while Zooming and Panning we developed the code in such a way that the projection is always be Perspective. And we are panning using glTranslate only.
Thank you very much for your kind response for my previous message.

Maybe you can add/subtract value of translation to/from vertices coordinates you use for grid painting. Another idea is to paint grid before painting all other stuffs, so it will be always on screen, but if you implement correct paning for elements, I think there will be no problems to handle points grid that way too.