Three.ar.js不良宽高比创造拉伸图像?

时间:2017-12-28 08:20:13

标签: javascript android three.js webvr arcore

不知道如何制定问题,但我得到的照片可能会让事情变得清晰。在那些我方便地称之为“糟糕的方面”的人中。你可以看到视频是出价倾斜/扭曲/拉伸的。 好的和坏的都基于相同的演示项目:https://github.com/google-ar/three.ar.js/blob/master/examples/spawn-at-surface.html 我在我的智能手机上使用两个应用程序制作了打印屏幕,我将手机设置为纵向模式,然后将其对角转动。

good aspect1

good aspect2

bad aspect1

bad aspect2

我认为线索可以在这里找到: enter image description here

它使drawingbufferheight成为4096,我认为应该是5661,就像viewportheight一样。尝试手动更改它,但我似乎无法使其工作。有什么想法或线索吗?

(使用three.js,three.ar.js和webVR API)

编辑:一些代码:

    this.renderer = new THREE.WebGLRenderer({ alpha: true});   
    this.renderer.setPixelRatio(window.devicePixelRatio);
    this.renderer.setSize(window.innerWidth, window.innerHeight);
    this.renderer.autoClear = false;
    this.canvas = this.renderer.domElement; 


    document.body.appendChild(this.canvas);

    this.scene = new THREE.Scene(); 

    // Creating the ARView, which is the object that handles
    // the rendering of the camera stream behind the three.js
    // scene
    this.arView = new THREE.ARView(this.vrDisplay, this.renderer);

2 个答案:

答案 0 :(得分:1)

虽然我使用的是Unity,但这是ARCore Preview 1中观察到的问题。您使用预览1还是2?如果为1,我建议您更新到预览2以查看它是否解决了问题。如果问题未在预览2中修复,则应在ARCore github问题中报告。

答案 1 :(得分:0)

它不再相关,我现在使用另一个版本,因为他们发布了修复程序。究竟发生了什么仍然是一个谜。

相关问题