提交 cf9f8ee1 编写于 作者: M Mr.doob

WebVRUtils: setProjectionFromUnion() now produces the correct frustum (changed...

WebVRUtils: setProjectionFromUnion() now produces the correct frustum (changed thing blindly though)
上级 f25d81ed
......@@ -40,13 +40,13 @@ function setProjectionFromUnion( camera, cameraL, cameraR ) {
// Calculate the new camera's position offset from the
// left camera.
var zOffset = ipd / ( Math.abs( leftFovL ) + Math.abs( rightFovR ) );
var zOffset = ipd / ( leftFovL - rightFovR );
var xOffset = zOffset * leftFovL;
// TODO: Better way to apply this offset?
cameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale );
camera.translateX( xOffset );
camera.translateZ( - zOffset );
camera.translateZ( - zOffset * 2 );
camera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale );
camera.matrixWorldInverse.getInverse( camera.matrixWorld );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册