Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

3D Model is not looking same as size in ARKit

Problem statement

I am facing a trouble in AR that our model size does not match with real products.This iPhone has the same dimension as real iPhone but it doesn't match with real products.

IPhone Model Size - (5.44 x 2.64 x 0.28 in)

Reference Screenshot

iPhone 7 in ARKit

Reference .obj file Download obj

like image 742
Arpit Avatar asked Oct 17 '25 01:10

Arpit


1 Answers

It's highly likely that the scale of the .obj is not correct.

If you load your model into the SceneKit Editor, and click on the 'cube' on the right hand side:

enter image description here

You will see in the transforms section an area which says Bounding Box.

You can check here to see if your model is actually the right size:

enter image description here

In my example my model is an SCNPlane with a width and height of 0.1m (10cm).

If your bounding box is then not correct, you will need to set the scale which can be done using the scale property of an SCNNode e.g:

model.scale = SCNVector3(0.1, 0.1, 0.1)

Whereby:

Each component of the scale vector multiplies the corresponding dimension of the node’s geometry. The default scale is 1.0 in all three dimensions. For example, applying a scale of (2.0, 0.5, 2.0) to a node containing a cube geometry reduces its height and increases its width and depth.

Hope it helps...

like image 99
BlackMirrorz Avatar answered Oct 18 '25 14:10

BlackMirrorz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!