Q: How to draw objects with sizes based on the number of pixels?


Can someone tell me how to draw a line, circle, etc. with a size based on the number of pixels rather than the view volume? For example, I can determine a point size by using glPointSize(size). The point size is independent from view volumes. I want to draw squares which should always look with the same size regardless of view volumes. These squares’ sizes have the same ratio to the screen even chaning view volumes. Is it possible? Please advise. Thanks.


use an orthogonal projection matrix with the size set to the windows size