Is the odd aspect ratio of Three.ar.js causing an image distortion?

I'm having trouble articulating my question, but I have some images that might help clarify things. In the ones labeled 'bad aspect', you can see the video appearing skewed/warped/stretched. Both examples are based on the same demo project: https://github.com/google-ar/three.ar.js/blob/master/examples/spawn-at-surface.html I took screenshots on my smartphone using both apps while holding my phone in portrait mode and then turning it diagonally.

https://i.sstatic.net/j0Xk6.jpg

https://i.sstatic.net/4Dmne.jpg

https://i.sstatic.net/npzo2.jpg

https://i.sstatic.net/GqOUA.jpg

I believe the solution may lie here: https://i.sstatic.net/Oed1c.png

The drawingbufferheight is set to 4096, but I think it should be 5661, matching the viewportheight. I tried manually changing it but couldn't get it to work. Any suggestions or hints?

(Currently using three.js, three.ar.js, and the webVR API)

edit: added some code snippets:

    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);

Answer №1

While working with Unity, I encountered a problem related to ARCore Preview 1. Are you currently using Preview 1 or have you upgraded to Preview 2? If you're still on Preview 1, I recommend updating to preview 2 to see if it resolves the issue. Should the problem persist in Preview 2, consider reporting it on the ARCore github repository for further assistance.

Answer №2

That information is outdated now, I have switched to a different version since they issued an update. The exact details of what occurred are still unknown.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I often find myself yearning for the good old days of prototyping functions when initializing a new

I just created a module in nodejs called Test.js with the following code: function Test() { this.key = 'value'; } Test.prototype.foo = function () { return 'foo'; } module.exports = Test; Then, in B.js file: var Test = require(&a ...

Organizing methods to manage changes in universal and specific states

There are certain components in my application that do not need to store all their state globally. Let me provide you with two examples: messages component: User messages are fetched and stored locally because they are only required for the current compo ...

Transferring an image from a canvas in Windows 8.1

Recently, I've been working on developing a paint program for Windows 8 using JavaScript. However, I have encountered a setback. I am struggling with the process of exporting an image from a canvas. While I am somewhat familiar with the FileSavePicker ...

Encase Regex Matches from the Inner Text of an Element in HTML Tags

I have a div element with some content inside. I am trying to use regular expressions to target specific parts of the text, wrap them in span elements with a class attribute "highlight-yellow" and add a custom attribute called my-custom-attribute="hello". ...

Having trouble retrieving information from Node.js service in AngularJS 2

I am currently expanding my knowledge of Angular and attempting to retrieve data from a node js service using Angular 2 services. When I access the node js services directly from the browser, I can see the results. However, when I attempt to fetch the dat ...

What is the easiest way to simulate a component's method?

My goal is to determine if a component method has been invoked following a store action, but I encountered an error: expect(jest.fn())[.not].toHaveBeenCalled() jest.fn() value must be a mock function or spy. Received: function: [Function bound mockCons ...

Ajax requests function properly only on one occasion

My select option works perfectly the first time, but then the request does not execute again. I suspect that the issue lies with the 'onchange' event. Here is my Ajax code : jQuery(document).ready(function($) { $('#referenceProduit') ...

Altering the color of points in a three.js point cloud buffergeometry

I am currently developing a straightforward application that showcases a video of a point cloud. The objective is to rotate through various point clouds at a designated frame rate. While the positional aspect of each point adjusts as desired, I am encount ...

How can I access a separate tab in Woocommerce directly from an icon on the single product page?

I am looking to enhance the functionality of a woocommerce single product page by allowing users to click on an icon below the short description. This will then automatically scroll them down to the tab section and open the corresponding tab. Scrolling do ...

Should Angular libraries be developed using Typescript or transpiled into JavaScript?

Currently, I am in the process of developing a library that will be available as an Angular module through npm. The library itself has been written using typescript. Everything was functioning perfectly up until Angular version 5.0.0, but after this update ...

Executing a cloud function in Firebase from an Angular-Ionic application by making an HTTP request

I am a newcomer to GCP and app development, so please bear with me if this question seems mundane. Currently, I have an angular-ionic app that is connected to Firebase allowing me to interact with the Firestore database. Now, my challenge is to invoke a ht ...

What could be causing the error? And is there a way to successfully append the child div to the parent div?

Here is the error message that I am encountering: Uncaught TypeError: Cannot read property 'appendChild' of null at HTMLButtonElement.<anonymous> Error is located at app.js on line 7 const flexContainer = document.querySelector(&apo ...

Mocha: A Unique Perspective on Testing the express.Router Instance

As I was developing a JavaScript controller file, I came across the need to test if my controller instance contains an instance of the express method called Router(). import {assert} from 'chai'; import {UF_Controller} from '../../controlle ...

Customizing File Size and Dimensions in Form Submission with Dropzone.js in JavaScript

I am currently experimenting with some sample code for Dropzone.js and am interested in finding a way to include the file size as a form field when submitting: var KTFormsDropzoneJSDemos = { init: function(e) { new Dropzone("#kt_dropzonejs_exam ...

Customize your click event with conditional styling in React

When the onClick event is triggered, I am attempting to modify a class by calling my function. It appears that the function is successfully executed, however, the class does not update in the render output. Below is the code snippet: import React from &ap ...

Issues with websockets functionality have been reported specifically in Firefox when trying to connect to multiple

I am currently working on a websocket client-server application. The client code is as follows: const HOST = "wss://localhost:8000"; const SUB_PROTOCOL= "sub-protocol"; var websocket = new WebSocket(HOST, SUB_PROTOCOL); websocket.onopen = function(ev ...

The div smoothly descended from the top of the page to the center under the control of jQuery

I am trying to implement a feature where a div slides down from the top of the page to the center when a button is clicked. However, my current code seems to be causing the div to slide from the bottom instead of the top. Ideally, I want the div to slide ...

Is it possible to automatically mute an HTML 5 video when closing the modal?

Is there a way to pause a video that plays in a modal and continues playing in the background when the modal is closed? I am using the Materialize library. <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script> <!-- Compiled ...

Populate a ListView in a fragment within one Activity by tapping a button in a separate activity

Greetings! I'm a complete beginner in coding, having started just 6 weeks ago. I've searched through numerous posts but haven't found the answer to my question yet. If there are any concepts I'm missing or better ways to accomplish this ...

The Challenge of Iterating Through an Array of Objects in Angular Components using TypeScript

Could someone please explain why I am unable to iterate through this array? Initially, everything seems to be working fine in the ngOnInit. I have an array that is successfully displayed in the template. However, when checking in ngAfterViewInit, the conso ...