0

As far as I understand, the value of near is always greater than far value. (near 1f, far 0.4f here).

Gl.glFrustum(-1f, 1f, -1f, 1f, 1f, 0.4f); 

since the Z axis is directed towards us, and the further away we are from it, the smaller the value. I hope I got that right?

my three-dimensional figure lies within the values 0.3 and -0.4 on the z axis (when we draw a figure, the z axis is directed away from the observer, not towards him, right?)

enter image description here

I set the following values for glfrustum and when I started the program, I didn't see anything on the screen. But when I turned the figure relative to the x axis by 20 degrees, I began to see it(I turned the figure towards me). That is, I set near and far, and the figure did not fall into the field of view, but when I turned it a little, it began to fall into this view area, right?

Gl.glFrustum(-1f, 1f, -1f, 1f, 1f, 0.4f); 

enter image description here

and why is it that when I set the value 0 for far, I see the figure in a normal state, as if I didn't use glFrustum at all?

Gl.glFrustum(-1f, 1f, -1f, 1f, 1f, 0.0f);

please tell me if I made a mistake somewhere in my reasoning. Most of all, I am concerned about the question of whether, when applying glFrustum(), the z-axis is now directed towards the observer, and not away from him?

Vs_De_S
  • 155
  • 1
  • 6
  • 0 < near < far! – Rabbid76 Oct 29 '22 at 06:36
  • @Rabbid76 you sent me this article yourself http://www.songho.ca/opengl/gl_projectionmatrix.html#perspective and the +z axis is directed towards the viewer, not away from him – Vs_De_S Oct 29 '22 at 06:38
  • @Rabbid76 Gl.glFrustum(-1f, 1f, -1f, 1f, 1f, 0.4f); when I changed the value of near from 1 to 4 here, I began to see the figure closer to me. – Vs_De_S Oct 29 '22 at 06:40
  • Yes, but that is what the projection matrix does, but not what you have to say to do. You only need to specify the distance to the near plane and the far plane. The top of the frustum is the position of the caamer. `near` and `far` are absolute distances. The perspective projection matrix converts from a right handed system (view space) into a left handed system (NDC). Read the answers to the duplicate questions and you will understand it all. There is no short answer. – Rabbid76 Oct 29 '22 at 06:40
  • @Rabbid76 okay....that is, should I still write like this? Gl.glFrustum(-1f, 1f, -1f, 1f, 0.4f, 10f); where far> near? I also tried Gl.glFrustum(-1f, 1f, -1f, 1f, 0.4f, 5f);but I didn't see any difference between them. why? – Vs_De_S Oct 29 '22 at 06:46
  • @Rabbid76 and why is it that when far or near has a value of 0, then the figure is in its normal state? – Vs_De_S Oct 29 '22 at 06:51
  • 1
    Pleas read! Read the answers to the duplicate questions! Read the [OpenGL 2.0 specification](https://registry.khronos.org/OpenGL/specs/gl/glspec20.pdf) The filed of view (angle) is defined by the near plane. The far plane only defines the clipping in the back. When you change the near plane, the filed of view changes. near=0 is undefined behavior (likely the projection matrix is not set at all) – Rabbid76 Oct 29 '22 at 06:51

0 Answers0