当我使用正交视图时,一切都被反转了 [英] All is inverted when i use orthographic view

查看:24
本文介绍了当我使用正交视图时,一切都被反转了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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?

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

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

推荐答案

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

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

three.js r.63

这篇关于当我使用正交视图时,一切都被反转了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆