Ivan Bacher
Ivan Bacher

Reputation: 6154

CSS3D renderer with Orthographic camera canvas origin changing?

When changing the camera from perspective to orthographic, the cameras position also seem to change so that 0,0,0 is located in the top left hand corner.

Is this behaviour correct?

See Example

Orthographic

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

Perspective

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

Perspective

Upvotes: 2

Views: 402

Answers (1)

WestLangley
WestLangley

Reputation: 104793

CSS3DRenderer does not support OrthographicCamera.

three.js r.73

Upvotes: 2

Related Questions