Any way to move the origin after scan ?


Hi everyone,

I’m looking for a way to move the origin into the center of the cube after scan has been released. Is it possible to change it on the STMesh ?

I need it to rotate from the center of the mesh in SceneKit.

Any help will be appreciated.



Something like this has been working for me…

        let bBoxMax = model.boundingBox.max
        let bBoxMin = model.boundingBox.min
        let isoCenter = SCNVector3((bBoxMax.x + bBoxMin.x)/2, (bBoxMax.y + bBoxMin.y)/2,
                                   (bBoxMax.z + bBoxMin.z)/2)
        model.pivot = SCNMatrix4MakeTranslation(isoCenter.x, isoCenter.y, isoCenter.z)


Thanks it work like a charm !

No way to modify the STMesh ?


Sure, the vertex data is accessible…