CSS3D渲染器与正交相机画布原点改变?

时间:2015-12-09 09:43:16

标签: javascript three.js

将相机从透视更改为拼写时,相机位置似乎也会发生变化,因此0,0,0位于左上角。

这种行为是否正确?

请参阅Example

正交

var h = window.innerHeight;
var w = window.innerWidth;

var viewSize = h;
var aspectRatio = w/h; //1 unit should be one pixel
var left = (-aspectRatio * viewSize) / 2;
var right = (aspectRatio * viewSize) / 2;
var top = viewSize / 2;
var bottom = -viewSize / 2;
var near = 1;
var far = 100;

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

Ortho

视角

camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 1, 10000);
camera.position.z = 500;

Perspective

1 个答案:

答案 0 :(得分:2)

CSS3DRenderer不支持OrthographicCamera

three.js r.73