【问题标题】:All is inverted when i use orthographic view当我使用正交视图时,一切都被反转了
【发布时间】:2013-12-01 23:20:52
【问题描述】:

我刚刚制作了一个带有边和顶点的 3D 图形,当我将视图更改为正交视图时,所有视图都是倒置的,并且可以在顶点内查看边,我认为这只是对法线的调整,但我不确定是否真的是这样。

我在这些顶点上方有标签,并且在正交视图中它是颠倒的。

有人有办法处理这种情况吗?

我正在使用 THREE.js 来构建这个图表

以下是执行相机投影的代码。

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);
}

【问题讨论】:

    标签: javascript three.js


    【解决方案1】:

    OrthographicCamera 的构造函数参数顺序错误。它们应该是:

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

    three.js r.63

    【讨论】:

    • 谢谢我在 args 中看到了问题
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-06
    • 1970-01-01
    相关资源
    最近更新 更多