arfoundation-samples icon indicating copy to clipboard operation
arfoundation-samples copied to clipboard

ARFoundation Scale Not Matching Real World Dimensions

Open nithishakumar opened this issue 3 years ago • 6 comments

I have a desk that is about 72 cm tall. image I created a cube in Blender of size 72 cm x 72 cm x 72 cm and exported it as a .obj model: image I placed the cube (with a scale factor of 1) next to the desk. The cube is a little shorter than the height it is supposed to be. You can check the cube's size in this video: https://www.youtube.com/watch?v=5SnEQumvs6g

This is the source code I have: https://github.com/nithishakumar/CubeAR/tree/main/Cube/Assets

I use a modified version of the PlaceOnPlane.cs script (to prevent UI raycasting) to place the cube.

Please check the "UI & AR scripts" folder for the modified PlaceOnPlane.cs script and the "Cube" folder for any other important info.

I'm unsure of why the cube is not tall enough. Any help would be appreciated!

nithishakumar avatar Jun 07 '22 20:06 nithishakumar

How does the size compare if you just create a 3D cube primitive in Unity and set its scale to .72 in all dimensions? This test would help determine if the scaling issue is caused by your asset or something else.

andyb-unity avatar Jun 13 '22 19:06 andyb-unity

Did you change the position of AROrigin?

Krustin avatar Jul 07 '22 11:07 Krustin

How does the size compare if you just create a 3D cube primitive in Unity and set its scale to .72 in all dimensions? This test would help determine if the scaling issue is caused by your asset or something else.

@andyb-unity I tested this out with the 3D cube primitive that has a scale factor of 0.72 in all dimensions. However, I am facing the same problem. It is not tall enough.

nithishakumar avatar Aug 05 '22 00:08 nithishakumar

Did you change the position of AROrigin?

@Krustin Nope, the ARSessionOrigin is at (0,0,0) with a scale factor of 1 in all dimensions.

nithishakumar avatar Aug 05 '22 00:08 nithishakumar

How does the size compare if you just create a 3D cube primitive in Unity and set its scale to .72 in all dimensions? This test would help determine if the scaling issue is caused by your asset or something else.

@andyb-unity I tested this out with the 3D cube primitive that has a scale factor of 0.72 in all dimensions. However, I am facing the same problem. It is not tall enough.

@nithishakumar you probably have, but I'm asking just in case. Are you sure that the bottom of the cube is aligned to the ground properly? I.e. the pivot point is at the height of the plane. And you don't happen to have AR Scale Interactable or similar on the object? That component will scale the object to the max value set.

ACWesterberg avatar Aug 08 '22 12:08 ACWesterberg

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 21 '22 11:09 stale[bot]

Closing this issue due to inactivity. Feel free to re-open it if you have further questions. @ACWesterberg has some good suggestions for further investigation.

andyb-unity avatar Sep 28 '23 20:09 andyb-unity