All is inverted when i use orthographic view

此生再无相见时 提交于 2019-12-11 10:57:25

问题


I just made a 3D Graph with edges and vertices and when i change the view to orthographic all is inverted and the edges can be viewed inside the vertices, i think that is just an adjust with the normals, but im not sure if is really that.

I have Labels above these vertices and its upside down in orthographic view.

Anyone have an idea to deal with this situation?

Im using THREE.js to build this graph

Below is the code that perform the camera projections.

var width = options.width || 800,
    height = options.height || 600,
    near = options.near || 0.1,
    far = options.far || 1000,
    cam;
if (options.ortho) {
  var right = width/30,
      top = height/30;
  var left = -right,
      bottom = -top;
  cam = new THREE.OrthographicCamera(left, right, bottom, top, near,
      far);
} else {
  var aspectRatio = width/height,
      fov = options.fov || 75;
  cam = new THREE.PerspectiveCamera(fov, aspectRatio, near, far);
}

回答1:


Your constructor args for OrthographicCamera are in the wrong order. They should be:

camera = new THREE.OrthographicCamera( left, right, top, bottom, near, far );

three.js r.63



来源:https://stackoverflow.com/questions/20312740/all-is-inverted-when-i-use-orthographic-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!