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
Reference .obj file Download obj
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:
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:
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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With