-1

I have a big SCNNode and I want to scale it down. Currently node is scaled down based on a magic number. However the node should be scaled down based on the phone's screen size or node's SCNView size.

To make things easier I thought of having a certain padding for node's SCNView/phone screen.

So, given a SCNNode and a certain amount of padding within the phone screen/SCNView, I would like you to calculate the scale factor for the SCNNode.

See the attached image for visual explanation. Can you help me to calculate the scale factor?

Visual explanation

ddeger
  • 1

1 Answers1

-1

You can get the screen scale factor with

UIScreen.main.nativeScale

or

UIScreen.main.scale