0

I am trying to place large 3D models (SCNNode) in ARSCNView using ARKit.

The approximate size is as follows : enter image description here

I have been through the following links :

is-there-any-size-limitations-on-3d-files-loaded-using-arkit

load-large-3d-object-scn-file-in-arscnview-aspect-fit-in-to-the-screen-arkit-sw

As per the above link, upvoted answer by alex papa, the model gets placed in scene. But the model seems above ground hanging in air. The 3D object seems floating in air and not placed on detected/tapped horizontal plane using hit test.

The x & z position is right but y seems some meters above the horizontal plane.

I need scale to be 1.0. Without scaling down the 3D model is it possible to place / visualise it right?

Any help or leads will be of help. Please provide valuable inputs!

MRR
  • 13
  • 3

1 Answers1

0

The scale of ARKit, SceneKit and RealityKit is meters. Hence, your model's size is 99m X 184m X 43m. Solution is simple – you need to take one 100th of the nominal scale:

let scaleFactor: Float = 0.01
node.scale = SCNVector3(scaleFactor, scaleFactor, scaleFactor)

And here you can read about positioning of pivot point.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
  • Hi @Andy Jazz, I need scale to be 1.0. Its my client's requirement. Updating this condition in above problem statement as well. Without scaling down the 3D model is it possible to place / visualise it right? – MRR Feb 04 '22 at 13:19
  • Then reimport a model from 3D package using a correct scale and correct pivot point position. – Andy Jazz Feb 04 '22 at 13:28