= sceneView.session.currentFrame { let mat = SCNMatrix4(frame.camera.transform) // 4x4 transform matrix describing camera in world space let dir = SCNVector3(-1 * mat.m31, -1 * mat.m32, -1 * mat.m33) // orientation of camera in world space let pos = SCNVector3(mat.m41, mat.m42, mat.m43) // location of camera in world space return (dir, pos) } return (SCNVector3(0, 0, -1), SCNVector3(0, 0, -0.2)) }
int x = round(in.uv.x * 375 * 3); int y = round(in.uv.y * 812 * 3); int index = x + y * 375 * 3; float value = heatmapTexture[index]; return ColorForHeat(value); } 4IBEFSNFUBM