Adding 3D object to ARGeoAnchor

At first you have to check if ARGeoTrackingConfiguration is supported on your device. Requirements: You need a device with A12+ chip and cellular (GPS) support. import ARKit @main class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { if !ARGeoTrackingConfiguration.isSupported { let sb = UIStoryboard(name: “Main”, … Read more

why is metal shader gradient lighter as a SCNProgram applied to a SceneKit Node than it is as a MTKView?

As explained in the Advances in SceneKit Rendering session from WWDC 2016, SceneKit now defaults to rendering in linear space which is required to have accurate results from lighting equations. The difference you see comes from the fact that in the MetalKit case you are providing color components (red, green and blue values) in the … Read more

Projecting the ARKit face tracking 3D mesh to 2D image coordinates

Maybe you can use the projectPoint function of the SCNSceneRenderer. extension ARFaceAnchor{ // struct to store the 3d vertex and the 2d projection point struct VerticesAndProjection { var vertex: SIMD3<Float> var projected: CGPoint } // return a struct with vertices and projection func verticeAndProjection(to view: ARSCNView) -> [VerticesAndProjection]{ let points = geometry.vertices.compactMap({ (vertex) -> VerticesAndProjection? … Read more

RealityKit vs SceneKit vs Metal – High-Quality Rendering

Updated: October 08, 2022. TL;DR This post is not only about RealityKit, SceneKit & Metal, but also about related APIs and USD files. RealityKit 2.0 RealityKit (and RealityFoundation) is the youngest SDK in Apple family of rendering technologies. This high-level framework was released in 2019. RealityKit is made for AR / VR projects, has simplified … Read more