akbartus / Simple-AR

Simple AR is a web-based image tracking library (platform) based on WebAssembly. It is also compatible with A-Frame, BabylonJs and ThreeJs frameworks.
https://webar-simple.glitch.me/
MIT License
35 stars 7 forks source link

Has Simple-ar broken. #4

Open luciousBrown opened 1 month ago

luciousBrown commented 1 month ago

Hi Akbartus, I was excited when i discovered Simple-AR as it was easy to use and the fact that you didn't need to go through hoops to set up an image marker, also the image also showed in aframe inspector, which meant you could position you objects how you wanted against the image. But for a while now I have noticed that it no longer works well as the object is no longer placed on image target but off kilter to the side above the marker. I have tested on both ios and android devices using both my projects and your examples and this is the same across the board. I have made no changes to my projects that previously worked well, neither have I changed devices.

Can you please tell me how this can be fixed as I would like to continue using this awesome library.

Many thanks.

L

AndieAstra commented 1 month ago

Hi there!

Are you using printed markers or one on a digital screen? Are the markers larger than the palm of your hand? I've found that if the marker is digital/too small there tends to be issues with the 3D model lining up. Lighting is another factor.

I'm using the Web AR coloring project, and there is a working example of Simple AR in it, perhaps comparing the two might find what is going wonky in Simple AR.

https://github.com/akbartus/WebAR-Coloring

luciousBrown commented 1 month ago

Hi and thank you for your speedy reply. I am testing on both business cards which worked perfectly before, on bigger images printed and on screen and also testinig with your example link https://webar-simple.glitch.me/ on the the example image you gave here with the pebbles and the result is the same. Your example worked perfectly before. This is on both android and ios. I have provide example image Screenshot_20240803-173804~01.

luciousBrown commented 1 month ago

Hi. I tested the links in the web Ar coloring page and the only one that is placing object on marker is the Mind Ar example. The Simple -AR example is having the same issue with object placed above marker, jittery and not persisting and the ar.js example is stretched. My preferred usage would be simple-AR over mind-Ar and ar.js due to it ease of use so I hope this can be fixed.

Thanks. L

akbartus commented 1 month ago

@luciousBrown hi! Thank you for your kind feedback. I would like to check the issue. Is there a possibility for you to show the code on glitch or elsewhere? I also checked the repo and did not identify the issues you mentioned

akbartus commented 1 month ago

@luciousBrown, any updates regarding your technical issue?

luciousBrown commented 1 month ago

Hi @akbartus thanks for asking. Just got back from a short break. So this is my glitch project https://glitch.com/~abyssinian-clammy-fact. It is using the other version of your Simple-AR library as I found it easier to work with plus i was able to add a "ar-only" class to it so that object is only visible in ar when marker is found. The only change made to Simple-AR itself was adding: let isInARMode = false; to Global Variables and : // Event listener for when the target is found document.addEventListener("targetFound", () => { isInARMode = true; // AR target found, enter AR mode console.log("Target found"); // Additional code to handle when the target is found if (target) { target.visible = true; } });

// Event listener for when the target is lost document.addEventListener("targetLost", () => { isInARMode = false; // AR target lost, exit AR mode console.log("Target lost"); // Additional code to handle when the target is lost if (target) { target.visible = false; } }); at end. As I mentioned, this was working perfectly before but now is no longer steady and I have made no changes to it since, so not sure what happened. Testing both on Ios and android and quite jerky and not positioned where it should be. Maybe I am missing something but would sure like to continue using this library. Please have a look at link provided.

Thanks

L

akbartus commented 4 weeks ago

@luciousBrown checked your example. Works as intended. See the screenshot made on Android device. screenshot

akbartus commented 4 weeks ago

Also, it is not jerky, just to confirm.

luciousBrown commented 3 weeks ago

Hi @akbartus , thanks for checking my example, highly appreciated. Unfortunately I am not getting good results as you can see from the video. I have tested on Android and iOS devices and result is the same so not sure if maybe it is supposed to that do as programmed by you. As you can see in this case the object does appear in front of marker image but I can not look to the side or above or below the object as it moves when I move the phone and is not static in 3d space (like how ar.js is). Please let me know if this is how it is supposed to work or if there is a solution. many Thanks. L

https://github.com/user-attachments/assets/0e1fd2f9-e97e-452b-9756-f6f47c63c94e