作业帮 > 英语 > 作业

OpenGL中Ortho函数的问题

来源:学生作业帮 编辑:作业帮 分类:英语作业 时间:2024/05/15 16:21:19
OpenGL中Ortho函数的问题
Ortho参数为left,right,bottom,top,near,far
根据三维坐标方向x轴向右y轴向上z轴垂直平面朝外,根据参数来说near>far
比如Ortho(-100,100,-100,100,100,-100)但是实际的效果确是Ortho(-100,100,-100,100,-100,100)即near
尊敬的玩家:
  Ortho参数为left
  使用glOrtho[1]函数可以交当前的可视空间设置为正投影空间.基参数的意义如图,如果绘制的图空间本身就是二维的,可以使gluOrtho2D.他的使用类似于glOrtho.
  函数用途
  设置或修改修剪空间的范围
  句法
  void glOrtho(GLdouble left,GLdouble right,GLdouble bottom,GLdouble top,GLdouble near,GLdouble far);
  描述
  这个函数描述了一个平行修剪空间.这种投影意味着离观察者较远的对象看上去不会变小(与透视投影相反).在3D笛卡尔坐标中想象这个修剪空间,左边和右边是最小和最大的X值,上边和下边是最小和最大的Y值,近处和远处是最小和最大的Z值.正射投影,又叫平行投影.这种投影的视景体是一个矩形的平行管道,也就是一个长方体.正射投影的最大一个特点是无论物体距离相机多远,投影后的物体大小尺寸不变.这种投影通常用在建筑蓝图绘制和计算机辅助设计等方面,这些行业要求投影后的物体尺寸及相互间的角度不变,以便施工或制造时物体比例大小正确.glOrtho就是一个正射投影函数.它创建一个平行视景体.实际上这个函数的操作是创建一个正射投影矩阵,并且用这个矩阵乘以当前矩阵.其中近裁剪平面是一个矩形,矩形左下角点三维空间坐标是(left,bottom,-near),右上角点是(right,top,-near);远裁剪平面也是一个矩形,左下角点空间坐标是(left,bottom,-far),右上角点是(right,top,-far).所有的near和far值同时为正或同时为负.如果没有其他变换,正射投影的方向平行于Z轴,且视点朝向Z负轴.这意味着物体在视点前面时far和near都为负值,物体在视点后面时far和near都为正值.
  编辑本段MSDN中的解释
  glOrtho NAME glOrtho -- multiply the current matrix by an orthographic matrix C SPECIFICATION void glOrtho(GLdouble left,GLdouble right,GLdouble bottom,GLdouble top,GLdouble near,GLdouble far) PARAMETERS left,right Specify the coordinates for the left and right vertical clipping planes.bottom,top Specify the coordinates for the bottom and top horizontal clipping planes.near,far Specify the distances to the nearer and farther depth clipping planes.These distances are negative if the plane is to be behind the viewer.DESCRIPTION glOrtho describes a matrix that produces a parallel projection.(left,bottom,-near) and (right,top,-near) specify the points on the near clipping plane that are mapped to the lower left and upper right corners of the window,respectively,assuming that the eye is located at (0,0,0).-far specifies the location of the far clipping plane.Both near and far can be either positive or negative.The current matrix is multiplied by this matrix with the result replacing the current matrix.That is,if M is the current matrix and O is the ortho matrix,then M is replaced with M*O.Use glPushMatrix and glPopMatrix to save and restore the current matrix stack.ERRORS GL_INVALID_OPERATION is generated if glOrtho is called between a call to glBegin and the corresponding call to glEnd.
《梦幻西游干将》团队团长为你服务
  如果还有什么疑问,请继续提问
  在我们的共同努力下,“知道”一定能成为充满温馨和智慧的知识社区