arkit

Unable to activate constraint with anchors

时光毁灭记忆、已成空白 提交于 2019-12-09 05:07:33
问题 So, I'm trying to create a sceneView programatically class ViewController: UIViewController, ARSCNViewDelegate { var sceneView: ARSCNView = ARSCNView() let configuration = ARWorldTrackingConfiguration() override func viewDidLoad() { super.viewDidLoad() self.sceneView.debugOptions = [ARSCNDebugOptions.showFeaturePoints, ARSCNDebugOptions.showWorldOrigin] self.configuration.planeDetection = .horizontal self.sceneView.session.run(configuration) self.sceneView.delegate = self self.sceneView

ARKit Place a SCNNode facing the camera

做~自己de王妃 提交于 2019-12-09 04:27:58
问题 I'm using ARKit to display 3D objects. I managed to place the nodes in the real world in front of the user (aka the camera). But I don't manage to make them to face the camera when I drop them. let tap_point=CGPoint(x: x, y: y) let results=arscn_view.hitTest(tap_point, types: .estimatedHorizontalPlane) guard results.count>0 else{ return } guard let r=results.first else{ return } let hit_tf=SCNMatrix4(r.worldTransform) let new_pos=SCNVector3Make(hit_tf.m41, hit_tf.m42+Float(0.2), hit_tf.m43)

Testing ARKit without iPhone6s or newer

狂风中的少年 提交于 2019-12-08 17:44:51
问题 I am before decision to download Xcode9. I want to play with new framework - ARKit. I know that to run app with ARKit I need a device with A9 chip or newer. Unfortunately I have an older one. My question is to people who already downloaded the new Xcode. There is a possibility to run ARKit app in my case? Any simulator for that or something else? Any ideas or will I have to buy new device? 回答1: ARKit is available on any iOS 11 device, but the world tracking features that enable high-quality

integrating ARKit in Flutter App using swift

旧巷老猫 提交于 2019-12-08 13:55:47
问题 I’m trying to create app using flutter for both android and IOS and I need to integrate AR in my app for IOS using ARKit. How I can continue working using swift in IOS app? 回答1: As I know, for now there is no such support in Flutter Today we don’t support for 3D via OpenGL ES or similar Official info 来源: https://stackoverflow.com/questions/53778473/integrating-arkit-in-flutter-app-using-swift

How can I pick item from collectionView and add it to SCNScene?

对着背影说爱祢 提交于 2019-12-08 13:43:12
问题 I am working with SceneKit and ARKit. I have made a collectionView with an array of emoji's. Now I want the user to be able to select the emoji from collectionView and when he/she touches the screen that selected emoji will be placed in 3D. How can I do that? I think I have to create a function for the Node, but still my idea is blurry in the mind and I am not very much clear. 回答1: As far as any emoji is a 2D element, it's better to use a SpriteKit framework to upload them, not a SceneKit.

How to measure device distance from face with help of ARKit in iOS?

谁说胖子不能爱 提交于 2019-12-08 13:32:32
I need to create a application in which we want to measure distance between device and my user face. I think its possible by ARKit but don't know how to do it. Is there any kind of sample or example? If you are running an ARFaceTrackingConfiguration (only for devices with a front-facing TrueDepth camera), there are at least two ways to achieve this (I think the second one is the better). First method You can use the depthData of the IR camera : yourARSceneView.session.currentFrame?.capturedDepthData?.depthDataMap This will return a CVPixelBuffer of size 640x360 containing depth data for each

ARKit 2 - Crop Recognizing Images

痴心易碎 提交于 2019-12-08 12:17:47
问题 So, my goal is: Find known image guard let referenceImages = ARReferenceImage.referenceImages(inGroupNamed: "AR Resources", bundle: nil) else { return } let configuration = ARWorldTrackingConfiguration() configuration.detectionImages = referenceImages . take a snapshot from sceneView func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) { let image = sceneView.snapshot() // or else self.sceneView.session.currentFrame?.capturedImage I need extract the image

How do it convert 2D Points From 3d Points in ArKit iOS

你离开我真会死。 提交于 2019-12-08 12:02:13
问题 how do i get the 2d points to plot on to uiview from 3d SCNNode. Suppose i have following SCNNodes pos(1.002163 -0.524722 -0.770023) pos(1.174463 -0.765098 -0.607172) pos(0.668790 -0.744061 -0.696863) pos(0.781208 -0.744061 -1.228943) And i need 2d points from above .I am new to arkit please help me 回答1: You are looking for projectPoint let projectedPoint = sceneView.projectPoint(pos) 来源: https://stackoverflow.com/questions/50741286/how-do-it-convert-2d-points-from-3d-points-in-arkit-ios

SCNShape not drawing with UIBezierPath under certain circumstances

痴心易碎 提交于 2019-12-08 11:48:14
问题 I believe this may be an iOS bug, and I've reported it to Apple via Bug Report. I'll post it here in case there's some workaround I can use, or explanation of the cause. I'm wanting to draw the stroke of a UIBezierPath within SceneKit. I'm using the CGPath copyStrokingWithWidth function, and then creating a SCNShape using the given path. This works fine for lines with 2 points, but on lines with 3 points, the SCNShape doesn't display anything. I've determined that this is only the case when

Detect touch on SCNNode in ARKit

自作多情 提交于 2019-12-08 08:49:24
问题 I have placed a SCNNode (a plane) at the location of a recognized image in ARKit 1.5 beta. I would like to print a message to the console when the plane is tapped on. So far I have this code: // MARK: - ARSCNViewDelegate (Image detection results) /// - Tag: ARImageAnchor-Visualizing func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) { guard let imageAnchor = anchor as? ARImageAnchor else { return } let referenceImage = imageAnchor.referenceImage