0

I am confused with volume of view which generated from glOrtho method , I know that last two parameters are for Z axis , first one represent the distance between viewer and near plane and second one represent distance between viewer and far plane .

my question is where the viewer(camera) lies exactly in Z coordinate ?

and in this link program some code that make near plane positive and far plane negative , in this case can we say that Z- is behind the viewer and Z+ is in front of viewer ?

if yes , try to make Z coordinate negative for all vertex of one of triangles , you will note that it appear although it is behind the viewer , why ??

Community
  • 1
  • 1
user1841718
  • 187
  • 1
  • 4
  • 15
  • if it helps you you can think of the camera as being in the nearval, no matter what the value is – h4lc0n Mar 11 '13 at 11:30

2 Answers2

4

first one represent the distance between viewer and near plane and second one represent distance between viewer and far plane

No, it isn't. An orthographic projection defines a box. The zNear and zFar are the positions of the box, not the distance from the "viewer".

Orthographic projections don't have a "viewer" in the same way that perspective projections do. They have a direction of view, not a view position. And the direction of the view is always the direction that puts zFar the farthest away and zNear being closest. If zNear is larger than zFar, then the direction of view is in the positive Z; otherwise, it's the negative Z.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
0

Actually your question is little bit confusing. I think you can try glLookAt() and make the object appear from a different angle and see the difference. here is a link http://mycodelog.com/2010/05/28/glcamera/

CodeRider
  • 1,750
  • 6
  • 18
  • 34