mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
Fix camera view projection issue
This commit is contained in:
@@ -83,7 +83,6 @@ module.exports = {
|
||||
this._camera.setNear(0.1);
|
||||
this._camera.setFar(1024);
|
||||
this._camera.setNode(this._cameraNode);
|
||||
this.updateCameraViewport();
|
||||
|
||||
if (CC_EDITOR) {
|
||||
this._camera.setColor(0, 0, 0, 0);
|
||||
@@ -105,12 +104,12 @@ module.exports = {
|
||||
}
|
||||
let node = this._cameraNode;
|
||||
let canvas = this.canvas;
|
||||
let zeye = canvas.height / 1.1566;
|
||||
node.x = canvas.width / 2;
|
||||
node.y = canvas.height / 2;
|
||||
let scaleX = cc.view.getScaleX();
|
||||
let scaleY = cc.view.getScaleY();
|
||||
let zeye = canvas.height / scaleY / 1.1566;
|
||||
_pos.x = node.x = canvas.width / scaleX / 2;
|
||||
_pos.y = node.y = canvas.height / scaleY / 2;
|
||||
node.z = zeye;
|
||||
_pos.x = canvas.width / 2;
|
||||
_pos.y = canvas.height / 2;
|
||||
_pos.z = 0;
|
||||
node.lookAt(_pos);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user