Objects erroneously managed in Android ARcore webXR

I forked the example for tape measurement in AR:

I add a monolith before starting the measurement part, and changed the markers from balls to monolyths.

As you can see, the first monolyth is rendered improperly, disregarding observer translations, while the markers are properly managed, considering 6 DOF rather than just 3…

Should this be considered a bug, or am I doing it wrong?

Howdy!

ot sure what you are referring to here? You are adding a box (with a default material) which is not being used in the rest of the implementation. The rest are the dots that render the same on each click. I would maintain a round object instead of a box, mainly because of the rotation added to the object from the hit-test implementation, but otherwise it seems to be working a expected

I changed the sphere to a box to check if the additional 3 DOF provided by ARcore (i.e translations) were used to render it, but I found they are not; but I see that actually Babylon does use these 3 DOF in rendering of the “dots”, and I think this is confusing: if I am creating an AR environment, shouldn’t every obejct be rendered taking into account 6 DOF? Or maybe I should create them in another way, or in another moment?

I will assume ARCore === WebXR :slight_smile:

Not sure what you mean here. Hit test provide you with a full transformation, including rotation. If you don’t want the rotation, don’t use it when decomposing the transformation matrix (keep it undefined). You can set the rotation yourself.

I don’t understand anything about rotation matrixes. :slight_smile: I would just like to add objects into an AR environment, I used the ARcore tape measurement example just to be sure it was a working AR example, but I don’t need hit test at all.

To be more clear: how could I walk around in Hill Valley scene using ARcore capabilities rather than mouse, i.e. by phyisically walking around in my livingroom??

Not arcore. WebXR. WebXR might use ARCore, or might not. it doesn’t matter. But if you are using babylon, you are using WebXR :slight_smile:

Now - how to do that? Open hill valley on your device, but convert the session mode to immersive ar instead of VR. this will allow you to walk around hill valley while holding your device.

I don’t know how to do it, I am using Babylon since just 1 week, and I am not very skilled with promises and javascript async functions, I have yet to understand the difference from putting my code in {} of the async funciton or inside its “.then({})”…

Oh, and -

I would recommend you to investigate that, because it is very important for your entire experience as developer.

1 Like