Post

Replies

Boosts

Views

Activity

SCNNode not at the center
Hi! I have the following problem: I create a SCNNode, which works perfectly fine, and add it to a SCNView as a childNode, that also works. However, when interacting with the scene, the node is placed somewhere on the screen/scene and not at the center, which causes weird behaviour when the user rotates the scene, since that rotation happens relative to the center of the view, but the node is - for example (not always) - on the left side, meaning the interaction is very hard to handle. The main use would be for the user to view the node (which represents a custom object) from different perspectives by rotating/zooming/etc. Here is my code: let scene = SCNScene()       prepareData() let geometry = createFromData() let objectNode = SCNNode()       objectNode.geometry = geometry scene.rootNode.addChildNode(objectNode)       self.sceneView = self.view as! SCNView self.sceneView.scene = scene       self.sceneView.backgroundColor = UIColor.black self.sceneView.allowsCameraControl = true I spent a lot of time debugging and trying to find what causes the problem, but I did not find the cause. I think the geometry should be fine, there are no outliers. Also, I tested with different objects (which I basically create from an array of points with x, y, z coordinates and rgb values) and sometimes it works as intended (even though there is no difference between the objects aside from the different coordinates of the points, obviously). At least it feels like that, the node still might not be exactly in the middle, but might just be off by a very small margin. Is there anything obvious that I am missing here? Any tips would be very much appreciated!
7
0
2.0k
Apr ’21
UIActivityViewController missing options
Hello! I use an UIActivityViewController in order to share some data generated in my app. Everything worked just perfectly until a few days ago a lot of the sharing options just disappeared (eg. Google Drive). Now, only "AirDrop", "Mail", Notes" and "Save to Files" is possible. That is the code: func save(path: URL) { DispatchQueue.main.async {     let ac = UIActivityViewController(activityItems: [path], applicationActivities: nil)       if let popover = ac.popoverPresentationController {       popover.sourceView = self.confidence       }     self.present(ac, animated: true) } } I did not change the code in the app and I also did not update my device. What could be the problem? What could lead to the options not being there anymore?
0
0
529
Mar ’21
Accessing and exporting LiDAR point cloud
I am trying to use the new LiDAR scanner on the iPhone 12 Pro in order to gather points clouds which later on will be used as input data for neural networks. Since I am relatively new to the field of computer vision and augmented reality, I started by looking at the official code examples (e.g., Visualizing a Point Cloud Using Scene Depth - https://developer.apple.com/documentation/arkit/environmental_analysis/visualizing_a_point_cloud_using_scene_depth) and the documentation of ARKit, SceneKit, Metal and so. However, I still do not understand how to get the LiDAR data. I found another thread in this forum (Exporting Point Cloud as 3D PLY Model - https://developer.apple.com/forums/thread/658109) and the given solution works so far. However, I do not understand that code in detail, unfortunately. So I am not sure if this gives me really the raw LiDAR data or if some (internal) fusion with other (camera) data is happening, since I could not figure out where the data comes from exactly in the example. Could you please give me some tips or code examples on how to work with/access the LiDAR data? It would be very much appreciated!
6
0
12k
Feb ’21