i m trying to know how size of window i.e. height and width
and gluOrtho effect the unit of translation in opengl
i.e size is width=500,height=500 and glOrtho(-4.0,4.0,-4.0,4.0,-30,30);
and if i write glTranslatef(-4.0,0.0,0.0);
then object will go to right end of window
but if we give width =800 and height =500
then same object will not go to at end
That is the definition of glOrtho. It defines a parallel projection matrix using what ever values you like.
Typically you would use this to define a “2D” overlay to your main scene. If you want that then you’d typcially like to use a convienient x and y coordinate scheme. I find using the window width and height convienient as so endup with: