I thought that the screen should be done like this glOrtho(0.0, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f) . But then the coordinates for the pixel need to be set to 0.001 ... and it is not clear whether there will be the same image at different resolutions. I just want to know how they do it for 2d and 3d the same way?

  • The question is unclear. Specify. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. - Kromster
  • What does "the same image" mean? Stretched to fit screen size? Or with the same size in pixels, but different indents? - HolyBlackCat
  • Well, for example, there is an image at a resolution of 1920x1080, this image is in the middle and does not overlap the screen area. But if the image is placed on the screen 1024x768, then it will go beyond the edge of the screen and will not be fully visible. I once read that such a problem is somehow solved. And at different resolutions, the image will be in the middle. But how? - xverizex pm
  • Well, you yourself said, you can calculate the exact coordinates for the angles of the quadrilateral. You ask how? There is an option to make ortho(0, ширина экрана, 0, высота экрана, -1, 1) , and then the coordinates will be immediately measured in pixels. You can repeat these calculations without the help of the matrices yourself. - HolyBlackCat
  • And if the image size is 1920x1080, then the screen at 1024x768 does not fit. So, for example, I did a game on unity3d a long time ago. The image differed quite a bit in width, but in general it was the same, which is on a monitor at 1920x1080, which is on the screen of a small phone, where the screen size is 480x ... I do not remember which resolution. - xverizex

0