arkit

What are the first two columns in SCNMatrix4

醉酒当歌 提交于 2019-12-04 19:49:45
I was reading the documentation for this struct but there seem not be enough information, m3 being the 3rd column of the matrix and m4 the 4th column contain the information about orientation and location of the node in 3D space correspondingly that I know because of some course on Udemy. Also right now the only way to extract the orientation and other things is: guard let pointOfView = sceneView.pointOfView else { return } let transform = pointOfView.transform let orientaiton = SCNVector3(-transform.m31, -transform.m32, -transform.m33) I guess API is different for the ARKit as compared to

Xcode 9 GM - Export and Upload to App Store crashing

时光毁灭记忆、已成空白 提交于 2019-12-04 18:41:59
问题 I'm trying to upload my app that uses ARKit (Unity build) to iTunes Connect for TestFlight distribution. While both exporting and uploading to app store processes from Xcode -> Organizer I see crash on "Stripping extended attributes for APPNAME.app". I checked all configuration of bitcode and symbols on/off, signing automatically, manually. Deployment target of my project is iOS 10, as 11 cannot be set. I also tried following steps from simillar thread (https://forums.developer.apple.com

ARKit - Update only the world coordinates origin

守給你的承諾、 提交于 2019-12-04 18:34:42
Once the user has scanned the environment and that I detected a plane, I would like the world origin anchor, which is the device position when the app opens (which is the origin of the 3D world), to be reset to where my device is right now so that the user can see my AR objects in front of him. (my objects are floating and not related to the floor but detecting a plane makes the objects more stable) I didn't find a way to do that. It's linked to ARConfiguration but it doesn't seem like we can update the coordinate system without resetting all the tracking. Do you have any idea? According to

Can I get 3d models from web servers on Swift?

半腔热情 提交于 2019-12-04 16:04:12
I'm working on an application with Arkit. There are many 3D models and the size is big in my app. Can I get these models out of another server (outside sites)? I'm new on swift, I can't seem to find anything on loading a 3d model from a web server. is it enough to change the model path there? Thank you func loadModel() { guard let virtualObjectScene = SCNScene(named: "\(modelName).\(fileExtension)", inDirectory: "Models.scnassets/\(modelName)") else { return } let wrapperNode = SCNNode() for child in virtualObjectScene.rootNode.childNodes { let defaults = UserDefaults.standard wrapperNode

ARKit: Reproducing the Project Point function

两盒软妹~` 提交于 2019-12-04 15:47:42
I'm attempting to reproduce the ARCamera's project point function, but for some reason the values are not matching up properly. I am taking the ARCamera's projection matrix and view matrix and applying basic CG perspective transform math, (PV) * p, but the NDC values do not match the pixel values given from the ARCamera's project point function. Any ideas? Am I forgetting something? Some more detail: Basically, I'm trying to take an ARFrame a the click of a button, and then trying to replicate the functionality of https://developer.apple.com/documentation/arkit/arcamera/2923538-projectpoint .

ARKit set ARAnchor transform based on touch location

白昼怎懂夜的黑 提交于 2019-12-04 12:57:20
I'm playing around with the AR starter app on XCode 9 where anchors are created in a scene on tap: override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { guard let sceneView = self.view as? ARSKView else { return } // Create anchor using the camera’s current position if let currentFrame = sceneView.session.currentFrame { // Create a transform with a translation of 0.2 meters in front // of the camera var translation = matrix_identity_float4x4 translation.columns.3.z = -0.2 let transform = simd_mul(currentFrame.camera.transform, translation) // Add a new anchor to the

Importing .scn file to scene from URL with textures

南笙酒味 提交于 2019-12-04 12:53:25
问题 I am using ARKit for my application and I try to dynamically load .scn files from web-server Here is a part of my code let url = URL(string: "http://192.168.0.31:1234/5a27e09cbad20a7a03ad5d80/box/box.scn") if let objectScene = try? SCNScene(url: url!, options: [.overrideAssetURLs: true]) { print("load success") let node = SCNNode() for childNode in objectScene.rootNode.childNodes { node.addChildNode(childNode) } sceneView.scene.rootNode.addChildNode(node) } else { print("error loading") }

How to use environment map in ARKit?

[亡魂溺海] 提交于 2019-12-04 11:04:07
ARKit 2.0 added a new class named AREnvironmentProbeAnchor. Reading it's instructions, it seems that ARKit can automatically collect environment texture (cubemap?). I believe that we can now create some virtual objects reflecting the real environment. But I am still not clear how this work, particularly how the environment texture is generated. Does anyone have simple sample code demonstrating this cool feature? Its pretty simple to implement environmentTexturing in your AR project. Set the environmentTexturing property on your tracking configuration to automatic (ARKit takes the video feed

Can I get the measurements for eyes using ARKit 2

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 08:44:38
问题 I am working on a project which requires size of each eye and distance between the eyes using ARKit and True depth Camera on iPhone X with iOS 12 beta 4 on Xcode 10 beta 4. As I am new to ARKit, I am searching the solution online with very little understanding. However, I came across a demo code on apple developer portal. In that code, I tried to fetch the required values. Also referred to the answer by @rickster I worked on ARSCNFaceGeometry and ARFaceAnchor to fetch few values. func update

How to put ARSCNView in Tabview controller without freezing the ARSession?

拜拜、爱过 提交于 2019-12-04 07:50:21
I am trying to implement ARKit of iOS 11 beta in my app(Tabbed application). But as said in ARKit Session Paused and Not Resuming thread, whenever i change the tab to another view controller and come back, the ARSession is getting freezed and not resuming. Is it possible to implement ARSCNView in a tabbed application so that if you come back i can resume the ARSession? If so how to do it? Yes, you can: override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) let configuration = ARWorldTrackingSessionConfiguration() sceneView.session.run(configuration, options: [