1 Reply
      Latest reply: Oct 3, 2017 10:20 PM by TonyPham RSS
      azamsharp Level 1 Level 1 (0 points)

        I am following the code from WWDC 2017: https://www.youtube.com/watch?v=ijsXzvif4vs

         

        When the sceneView.snapshot displays the plane on the screen, it is already rotated 90 degrees. I am holding the phone in portrait mode.

         

          private func capturePhoto() {
               
                guard let currentFrame = self.sceneView.session.currentFrame else {
                    return
                }
               
                let photoPlaneNode = PhotoPlane(image: self.sceneView.snapshot())
                photoPlaneNode.eulerAngles.z = (Float.pi) * (-1)
               
                var translation = matrix_identity_float4x4
                translation.columns.3.z = -1.0
               
                photoPlaneNode.simdTransform = matrix_multiply(currentFrame.camera.transform,translation)
                self.sceneView.scene.rootNode.addChildNode(photoPlaneNode)
               
            }
        

         

        Any ideas?