Extracting vertices from scenekit

The geometry source When you call geometrySourcesForSemantic: you are given back an array of SCNGeometrySource objects with the given semantic in your case the sources for the vertex data). This data could have been encoded in many different ways and a multiple sources can use the same data with a different stride and offset. The … Read more

ARKit – What do the different columns in Transform Matrix represent?

ARKit, RealityKit and SceneKit frameworks use 4 x 4 Transformation Matrices to translate, rotate, scale and shear 3D objects (just like simd_float4x4 matrix type). Let’s see how these matrices look like. In 3D Graphics we often use a 4×4 Matrix with 16 useful elements. The Identity 4×4 Matrix is as following: Between those sixteen elements … 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

How to use iOS (Swift) SceneKit SCNSceneRenderer unprojectPoint properly

Typical depth buffers in a 3D graphics pipeline are not linear. Perspective division causes depths in normalized device coordinates to be on a different scale. (See also here.) So the z-coordinate you’re feeding into unprojectPoint isn’t actually the one you want. How, then, to find the normalized-depth coordinate matching a plane in world space? Well, … Read more