-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera loading on full zoom #369
Comments
@curtisboylan is it the real-world camera that is zoomed in, the 3D scene, or both? is this specific to AR.js, or does the same thing happen when viewing other web pages that use the camera on this device? It would be helpful if you could include screenshots to help diagnose Thanks! |
I am also facing this issue. Till date, i was building my application on glitch. But today i thought of opening that glitch live url on the phone. And to my surprise, the camera gets opened in full zoom mode. I am also using Android 7.0 device. Earlier i was testing the application in windows 8.1. Edit 1: @gabrielgrant You can check by opening below url in both windows as well as android 7.0. It requires a hiro marker to project a cone over it. https://lackadaisical-college.glitch.me edit 2: I tried removing the embedded component from a-scene and after that camera loaded perfectly. However, the projected image is getting displayed away from marker. And that too in some small window. |
phewww!! Issue is resolved. Just replace below line in index.html
with this.
|
@gabrielgrant This zooming issue I am having is real life with the camera. |
Interesting, thanks for the workaround @manishbansal8843 does that work for you, @curtisboylan ? |
@manishbansal8843 @gabrielgrant This is working for me but unfortunately is very very zoomed out. It looks like a desktop version is running on the android and also the "content" displays far away from the actual poster. Any fix for this? |
Yes, it sounds like the original issue you reported is caused by the mobile browser trying to adjust the zoom/scale of pages to look better than just showing the entire desktop content. The workaround forces the browser to display the content without any zooming (ie showing the full content). If you want the content partially zoomed, I imagine you may able to set the |
@gabrielgrant Is there any other solution? It is only on this certain android version. If I changed CSS etc it will effect all versions and all phones?? |
Which specific versions of android (and chrome?) have you tested with that it does and does not apply to? Without being able to see this issue reproduced, it's hard to give more advice here. If you'd like more help, please provide a MCVE (ideally on JSFiddle or similar) and some screenshots of the problem (and, if you have access to a device that you think shows the correct behavior, some shots from that for comparison) |
I have tried Android 7.0 on two different devices. Unfortunately I don't have a screenshot of the one with the main issues as phone is out of the office right now but I will attach the screenshots of the other phone which is working perfect apart from the header is displaying off screen. Everything else works on this one. (xperia l1 android 7.0) The one we are having issues with is android version 7.0 on a huawei p8 lite. To give you a perspective of what is happening without being able to show you basically our header image loads in the top left corner absolutely tiny, the camera seems to have an ok zoom but when I point it at any of our markers the AR content displays away from the marker to the side of it and sometimes off view. It is like it is zooming everything very weirdly no idea why. Before inserting @manishbansal8843 fix it was zoomed all the way in and couldn't be used at all. I have pasted the code I am using here https://pastebin.com/zTkthxC9 so maybe you can get a better idea. I am not sure how many devices this is happening on as I only have access to two mobiles right here but if you have an Android you can try it too at https://curtisboylan.com/SAP/playground/aframe/examples/all.html Screenshot of the semi broken but still working Android attached and fully working iOS attached Cheers. |
@gabrielgrant I just got hold of that phone again and tried using @manishbansal8843 site. I will attach a screenshot of the issue. The same thing is happening on mine. The little "VR Goggle" is tiny and the marker projection is going off screen. Any ideas? |
@curtisboylan For the issue in which AR content is being displayed away from marker, do you have any other HTML element inside body but outside a-scene element ?
I also faced this issue. And i found out that one of the reason for this is having other HTML elements within your body tag. |
@manishbansal8843 Yeah one thing I have in there is a header div, I will try removing it but I have removed it before and it made no difference. I do see though that yours still has the same issue on my phone here with the issues when I browse to your site, do you know this or did you fix it somewhere else? |
@gabrielgrant @manishbansal8843 any update on a solution to this? Still the same issue on this device. |
@curtisboylan thanks for the extra details. To confirm, this only happens with AR.js? or is does this also happen with other, non-AR.js-based A-frame content? Also, mind showing what it looks like with |
@gabriel yeah seems to only happen with ar.js but I haven’t noticed with any other web pages. Then screenshots are the scales set to 1, it looks ok with the scale set to 1 but the marker images appear off the marker as the screenshot shows
…________________________________
From: Gabriel Grant <notifications@github.com>
Sent: Monday, July 2, 2018 11:58:11 PM
To: jeromeetienne/AR.js
Cc: Curtis Boylan; Mention
Subject: Re: [jeromeetienne/AR.js] Camera loading on full zoom (#369)
@curtisboylan<https://github.com/curtisboylan> thanks for the extra details. To confirm, this only happens with AR.js? or is does this also happen with other, non-AR.js-based A-frame content?
Also, mind showing what it looks like with initial-scale, minimum-scale, and maximum-scale set to 1?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#369 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AT4XusZbcbKZkDB9ZbMAPKdkKtN2k0ePks5uCqWDgaJpZM4UtOqh>.
|
@gabrielgrant I have now tried on another browser on that Android phone and it works and is zoomed correctly but does not display markers at all? |
had the same issue on Android Samsung S7 on Chrome. |
@fariskas could you show your whole code if possible? |
mine is just the basic demo setup for ar.js. |
I can confirm that @manishbansal8843 's meta tag solution works for the zooming issue. As for the AR assets not appearing with the level of precision you'd want, I am experiencing that bug as well on my Samsung Note 8 running Android@8.0.0 and Chrome@68.0.3440.91 |
(Edited as some of the previous info I shared was confusing the issue, sorry). I'm experiencing the same issue with our code lab, in Chrome 70 and Samsung Internet v8.x (based on Chromium 63), but not Samsung Internet v7.x (based on Chromium 59). One thing that's apparent from the broken version is that the canvas is massive. In Samsung Internet v7.2 on a Pixel 2 phone, the canvas is 1945 x 1459 and the video element is 417 x 556. But in Chrome on the same device, the canvas is 8455 x 6342 and the video element is 1812 x 2416. So perhaps it appears zoomed in, because the canvas is massive and you can only see a small portion of it? An initial theory: the viewport meta tag solution above may be simply masking the fact that the canvas is massive, because it scales it down to fit the viewport? It does prevent it from appearing zoomed in, but then I have the same problem as @curtisboylan - the object I place on the marker is not appearing in the right place. (Whereas it is in Samsung Internet v7.0, it's placed correctly). I'll need to keep digging into this because we need to get our code lab working, but any further pointers in the meantime would be very welcome. Thanks! |
I do not see the same issue with the 'A-Frame basic' example here though. Here's how it looks in Samsung Internet v7: And here's how it looks in Chrome 70: (The debug elements are not visible in the former and the overlay elements are cut off on the left, but) there is no difference in zoom. So now I'll compare this example with our code lab and figure out why ours isn't working... |
So the difference between the two was that the A-Frame basic example does not have a viewport meta tag at all. I removed ours too and it solved the zoom issue in Chrome. Unfortunately this does not solve the problem in Samsung Internet v8 on the Note 9, though. The A-Frame basic example has the same issue here: But I realised that if I switch off the 'Manual Zoom' here in the settings menu... ...then, it's a bit pixellated, but the whole camera view is visible: (NB. Possibly related to the fact it's pixellated on the Note 9 - I'm seeing errors in the console that say "Failed to recalculate device parameters" (Dpdb.recalculateDeviceParams) from the WebVR polyfill via A-Frame, although not sure if that's used for resolution settings by AR.js or if it's just for the VR resolution?) |
Any progress on this? It was working fine with my Android A5, but (I think) after the latest OS update of 1 january 2019 this issue appeared. (Also with the basic "try on mobile" example of jerommeetienne). My results so far:
|
hello, I am experiencing this full zoom issue too but only with iOS/safari machines but works fine with android/ chrome/ samsung b(r)owser. |
I have the same problem on this. Any progress on it...? I think #299 is also really resemble, but I write as follows and it still does not work. |
I have the same problem with a huawei p30. I discovered that the camera with the excess of zoom, is only one of the cameras that has the device. I ask, how could I change the origin of the camera in a-frame? |
I found out that the error of showing debug messages only for an half, is a matter of CSS style. I will make a simple PR to fix that for both desktop and mobile. Already tested it. |
As @nachoaguirre already mentioned: the problem occurs while AR.js is selecting the wrong camera! New phones have multiple back-cameras, AR.js takes per default the first envirenment/back-camera, which fullfills the defined constraints. The solution for this problem would be: Let the user switch between cameras! Somewhere here in AR.js:
How could we let the User toggle between available devices?
|
Guys which phone do you have? It's confirmed that this is caused by phones with multiple cameras? |
@nicolocarpignoli Mine is Huawei P20 pro - I can definitely confirm that the camera which got selected by AR.js is the wrong camera; it is the first one in the list of "facing back" cameras - On Huawei P20 pro there are 4 different facing back cameras and the first one is that one which is extremely zoomed in - same zoom level like in a simple AR.js demo. |
I may include this feature in next version. We can do this way: show a dialog to select the camera only if more than 2 cameras are available. Otherwise act like now selecting rear camera |
I can't test it, can anyone help me next days with a test for this new feature? |
@nicolocarpignoli please don't show a dialog, since this is disruptive for the user experience. Select the default camera, like now, and give the devs the possibility to handle this for their users. for example a small switcher in the corner (on click switch to next available camera; even front cam could be in the list, for augmented face masks in the future? :p ) |
Yeah that's the main reason I'm having the issue. when I use a browser that lets me pick the camera, i choose the camera that is NOT my wide angle lens and the application works as intended. |
I may have done some progress to this. Can anyone please test? See there: #661 (comment) |
Sharing an ugly fix for the multiple camera phones issue: In aframe-ar.js (2.0.8) right after declaring `var userMediaConstraints = { // CUSTOM CODE START It's surely not bulletproof but so far I can't break it. It even fixed a Honor 8 problem where ARjs was using the front camera. Hope it helps :) |
@kvabakoma
Check my PR on pull requests it may help. I did the same thing of yours
|
@tommensink - we found a workaround for the SamsungBrowser zooming && 3d offset. |
lifesaver dude |
feel free to re-open this discussion at: https://github.com/AR-js-org/AR.js if still needed help for someone |
Using an iframe helped me to fix it on my Samsung S6 (in the Samsung browser). Solution from here: https://stackoverflow.com/a/14738668/5028033 This is what I use now as iframe "container". Project code is in project.html then: |
That did it for me. |
Closes #1 Thanks to jeromeetienne/AR.js#369 (comment)
@curtisboylan Did you manage to solve this problem? Because I'm having the same problem? |
@LucasYuugi wow, this is a throwback, haven't touched this in quite a while... did you try @rainerlonau 's iframe workaround? any luck with that? |
@gabrielgrant My problem is that in my code, when I remove the zoom with this code: |
@curtisboylan Can you did resolve this problem? |
@rainerlonau |
@LucasYuugi Hi, sorry I can´t help atm. My solution is over two years old. I didn´t touch this framework since then. Also our project was only a prototype back then, so it´s not maintained. Did you create a clean demo project using AR.js basic sample? Then apply my workaround with the iFrame? Does that still work? |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
If I load the webpage on Android 7.0 on Huawei P8 Lite it zooms very far in meaning I cannot use the application correctly.
If the current behavior is a bug, please provide the steps to reproduce.
Just loading the page on the phone does it it, you don't need to do anything special. The camera will load with a full zoom.
What is the expected behavior?
I would expect that it does not zoom and works properly like on every other phone/device but unfortunately on this phone with Android 7.0 the camera is zooming in fully.
If this is a feature request, what is motivation or use case for changing the behavior?
Please mention other relevant information such as the browser version, Operating System and Device Name
android version 7.0 huawei p8 lite
The text was updated successfully, but these errors were encountered: