Three.ar.js 错误的纵横比创建拉伸图像?
Three.ar.js bad aspect ratio creating stretched image?
我真的不知道如何提出这个问题,但我得到了一些可能会使事情变得清晰的图片。在我方便地称为 'bad aspect' 的视频中,您可以看到视频正在出价 skewed/warped/stretched。
好的和坏的都基于同一个演示项目:https://github.com/google-ar/three.ar.js/blob/master/examples/spawn-at-surface.html
我在我的 smartphone 上用这两个应用程序制作了打印屏幕,我把我的 phone 保持在纵向模式,然后将它转向对角线。
而且我认为可以在这里找到线索:
它使 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);
虽然我使用的是 Unity,但这是 ARCore 预览版 1 中观察到的问题。您使用的是预览版 1 还是预览版 2?如果是 1,我建议您更新到预览版 2,看看它是否能解决问题。如果问题未在预览版 2 中修复,您应该在 ARCore github 问题中报告它。
它不再相关了,我现在使用另一个版本,因为他们发布了修复程序。到底发生了什么仍然是个谜
我真的不知道如何提出这个问题,但我得到了一些可能会使事情变得清晰的图片。在我方便地称为 'bad aspect' 的视频中,您可以看到视频正在出价 skewed/warped/stretched。 好的和坏的都基于同一个演示项目:https://github.com/google-ar/three.ar.js/blob/master/examples/spawn-at-surface.html 我在我的 smartphone 上用这两个应用程序制作了打印屏幕,我把我的 phone 保持在纵向模式,然后将它转向对角线。
而且我认为可以在这里找到线索:
它使 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);
虽然我使用的是 Unity,但这是 ARCore 预览版 1 中观察到的问题。您使用的是预览版 1 还是预览版 2?如果是 1,我建议您更新到预览版 2,看看它是否能解决问题。如果问题未在预览版 2 中修复,您应该在 ARCore github 问题中报告它。
它不再相关了,我现在使用另一个版本,因为他们发布了修复程序。到底发生了什么仍然是个谜