arkit

Replacement for ARKit in iOS10

◇◆丶佛笑我妖孽 提交于 2019-12-29 01:29:31
问题 I want to include ARKit in an app designed for iOS10+ where I replace ARKit with SceneKit if the iOS version is <11. Unfortunately it seems like there is no way to currently do this? 回答1: Depending on how you've set your expectations, it is possible to use SceneKit as a "fallback" from ARKit -- specifically, from ARSCNView . What you can easily do is create a 3D content experience that appears "in the real world" via AR when running on an ARKit capable device, and in an entirely virtual

Why iPhones XR, XS and XS Max, doesn't apply environment image to scene in ARKit?

会有一股神秘感。 提交于 2019-12-25 03:45:33
问题 After download everything from backend (textures, environment, 3D object) into the app, I created a new SCNScene programmatically, with all this stuff. It works perfectly on all devices, but on iPhones XR, XS and XS Max the textures of those models, that need environment image appear black. As if "None" environment was set. I can't post code nor images, it's not my project. I'd just like to know if anyone has experienced any problems of this kind, with iPhone XR, XS or XS Max and ARKit. It's

ARKit -[UIView setAnimationsEnabled:] Performing any operation from a background thread on UIView or a subclass is not supported

风格不统一 提交于 2019-12-25 01:46:53
问题 I have a ViewController that has a collectionView inside of it. I display the contents of the collectionView's cells inside an ARSCNView. When I set the ViewController's view property to the Material's content property I get the error from the question. material.diffuse.contents = self.myViewController.view // produces error and sometimes it crashes. When it does't crash I can see the collectionView fine but the error is still there I know it's the vc's view property that is causing the

Not able to load .dae file while creating a SCNScene object in ARKit

梦想的初衷 提交于 2019-12-25 01:45:50
问题 I am trying to load a .dae file with the help of the following line of code: let scene = SCNScene(named: "art.scnassets/bench.dae") But, when I run my project, the app is crashing because the variable scene is nil. What am I doing wrong? 回答1: It seems that the problem was with the .dae file's size/orientation. I rotated it by 90 degrees and scaled the image down and it seems to work now. 回答2: I know this is pretty old, but in case anyone faces this issue like i had yesterday, here is what I

Record video from front facing camera during ARKit ARSession on iPhone X

半腔热情 提交于 2019-12-25 01:34:55
问题 I'm using an ARSession combined with an ARFaceTrackingConfiguration to track my face. At the same time, I would like to record a video from the front facing camera of my iPhone X. To do so I'm using AVCaptureSession but as soon as I start recording, the ARSession gets interrupted. These are two snippets of code: // Face tracking let configuration = ARFaceTrackingConfiguration() configuration.isLightEstimationEnabled = false let session = ARSession() session.run(configuration, options: [

ARSCNView freezes when adding 14 ARAnchor subclass objects with strong reference

耗尽温柔 提交于 2019-12-24 19:39:01
问题 I have next code: guard let feauturePoint = frame.hitTest(normalizedPoint, types: .featurePoint).first?.worldTransform else { return } let anchor = MyAnchorSubclass(transform: feauturePoint, plus: someAdditionalInfo) arSession.add(anchor: anchor) This function creates and adds object of my subclass of ARAnchor. Then... func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) { guard let anchor = anchor as? MyAnchorSubclass else { return } anchors.append(anchor)

How to display web page in ARKit ios

给你一囗甜甜゛ 提交于 2019-12-24 11:02:55
问题 Which spritekit or sceneKit node should I use to display a web page in Arkit? As we usually embed other iOS views in arplane as materials. 回答1: I got empty pages containing background color of the loaded site after I tried to directly add my WKWebView instance to my node like this: node.geometry?.firstMaterial?.diffuse.contents = webView The only way I could show a WKWebView content in my ARKit 3D environment was to load the webView, wait for it to fully load and then take a screenshot of the

How to make SCNNode is always toward to ARFrame.camera

百般思念 提交于 2019-12-24 06:59:10
问题 - (void)session:(ARSession *)session didUpdateFrame:(ARFrame *)frame { SCNNode *shipNode = self.sceneView.scene.rootNode.childNodes[0]; if (shipNode) { shipNode.eulerAngles = SCNVector3FromFloat3(frame.camera.eulerAngles); } } I want to change ship's orientation with camera's moving, but the above code seems useless. 回答1: Use an SCNBillboardConstraint to keep one node pointed toward another node. 来源: https://stackoverflow.com/questions/44921072/how-to-make-scnnode-is-always-toward-to-arframe

How to make SCNNode is always toward to ARFrame.camera

我的未来我决定 提交于 2019-12-24 06:59:06
问题 - (void)session:(ARSession *)session didUpdateFrame:(ARFrame *)frame { SCNNode *shipNode = self.sceneView.scene.rootNode.childNodes[0]; if (shipNode) { shipNode.eulerAngles = SCNVector3FromFloat3(frame.camera.eulerAngles); } } I want to change ship's orientation with camera's moving, but the above code seems useless. 回答1: Use an SCNBillboardConstraint to keep one node pointed toward another node. 来源: https://stackoverflow.com/questions/44921072/how-to-make-scnnode-is-always-toward-to-arframe

Keep node's X and Z axes parallel to ground while rotating Y axis to face camera

拈花ヽ惹草 提交于 2019-12-24 06:43:29
问题 I'm trying to keep an SCNNode always one meter away from the front of the camera, and manipulate the node so that the X and Z axes are always parallel to the ground, while the node rotates around the Y-axis so that the node is always facing the camera. The code below achieves my goal for the most part, but when turning more than 90˚ clockwise or counterclockwise, the node starts turning. How can I fix that? override func viewDidLoad() { super.viewDidLoad() boxParent.position = (sceneView