# fromSurfaceRotation Source: https://www.nianticspatial.com/docs/api/kotlin/com.nianticspatial.nsdk.Orientation.fromSurfaceRotation/ fromSurfaceRotation --- ## Declaration fun fromSurfaceRotation(rotation: Int): Orientation #### Summary Converts an Android display rotation into the corresponding device Orientation. Pass the value returned by Display.rotation -- one of Surface.ROTATION_0, Surface.ROTATION_90, Surface.ROTATION_180, or Surface.ROTATION_270. Any unrecognized value maps to UNKNOWN. This produces the device/UI orientation expected by FrameData.screenOrientation and by the orientationProvider of createLiveDataSource. It is the inverse-free, sensor-agnostic mapping; renderers that need the flipped landscape convention should additionally apply their own rendering transform rather than swapping here. #### Returns The matching Orientation, or UNKNOWN if unrecognized. ### Parameters | Name | Type | Summary | | --- | --- | --- | | rotation | Int | A `Surface.ROTATION_*` value (typically `Display.rotation`). | ---