arkit

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

ε祈祈猫儿з 提交于 2019-12-08 07:22:49
问题 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? 回答1: 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?

How to import a dae to SceneKit for ARKit

北城以北 提交于 2019-12-08 05:57:42
问题 If I run Xcode's ARKit project template, I can move around the default ship as expected. I have tried importing some dae models that I have exported from Blender, switching the ship to the new item but keeping the code the same. They always show in view but position in front the camera. If I try to move around the model it sticks infront of the camera and doesn't stay in the same virtual space. I have also tried importing a dae from another tutorial and that works as expected. Does anything

ARKit floating planes

此生再无相见时 提交于 2019-12-08 05:29:59
问题 Sometimes ARKit creates plane over existing one. It doesn't merge them. I am testing ARKit with iPhone 7 in closed space. Object placed on that plane appears to float in space. This scenario doesn't happen often, and I can't reproduce it all the time. Can someone tell me how to prevent overlapping and floating planes to appear? Or how to place 3D object on bottom plane? Here is the code for drawing planes. func createPlaneNode(center: vector_float3, extent: vector_float3) -> SCNNode { let

How do I rotate an arkit 4x4 matrix around Y using Apple's SIMD library?

左心房为你撑大大i 提交于 2019-12-08 02:01:12
问题 I am trying to implement some code based on an ARKit demo where someone used this helper function to place a waypoint let rotationMatrix = MatrixHelper.rotateAboutY( degrees: bearing * -1 ) How can I implement the .rotateAboutY function using the SIMD library and not using GLKit? To make it easier, I could start from the origin point. I'm not too handy with the matrix math so a more basic explanation would be helpful. 回答1: The rotation around Y matrix is: | cos(angle) 0 sin(angle)| | 0 1 0 |

Programmatically setting texture in Scene generated by Reality Composer

余生长醉 提交于 2019-12-07 17:28:33
I am creating a cylinder object using Reality Composer. My requirement is to wrap the cylinder with custom image. Image is dynamically created by the app. I have tried following approach and so far it's not working. After loading the anchor from Experience. Fetch model entity from anchor. Fetch model component from model entity. Add or edit material. Code: // Load the "anchor" scene from the "Experience" Reality File let anchor = try! Experience.loadAnchor() // Add the anchor to the scene arView.scene.anchors.append(anchor) let cylinderEntity : Entity = anchor.cylinder! let cylinderModelEntity

dyld_shared_cache_extract_dylibs failed for 6s plus running on iOS 13.1.3

。_饼干妹妹 提交于 2019-12-07 15:33:06
问题 I am trying to run AR Project in device it gives me an dyld_shared_cache_extract_dylibs failed error. My system OS is Mojave 10.14. I tried this and this answer. But still having the same issue, Not able to run my application. Thanks in Advance. 回答1: This is happening because somehow older versions of Xcode have an issue creating these cache files properly - try below: Close Xcode Install the device support profile that matches your iOS version from here Go to: ~/Library/Developer/Xcode/iOS

iOS 11 ARKit : Drag Object in 3D View

老子叫甜甜 提交于 2019-12-07 03:01:28
I have a node object in 3d view and i need to drag that object, So far i have tried from here : Placing, Dragging and Removing SCNNodes in ARKit and converted in swift @objc func handleDragGesture(_ gestureRecognizer: UIGestureRecognizer) { let tapPoint = gestureRecognizer.location(in: self.sceneView) switch gestureRecognizer.state { case .began: print("Object began to move") let hitResults = self.sceneView.hitTest(tapPoint, options: nil) if hitResults.isEmpty { return } let hitResult = hitResults.first if let node = hitResult?.node.parent?.parent?.parent { self.photoNode = node } case

ARKit / SpriteKit - set pixelBufferAttributes to SKVideoNode or make transparent pixels in video (chroma-key effect) another way

你离开我真会死。 提交于 2019-12-06 23:01:25
问题 My goal is to present 2D animated characters in the real environment using ARKit . The animated characters are part of a video at presented in the following snapshot from the video: Displaying the video itself was achieved with no problem at all using the code: func view(_ view: ARSKView, nodeFor anchor: ARAnchor) -> SKNode? { guard let urlString = Bundle.main.path(forResource: "resourceName", ofType: "mp4") else { return nil } let url = URL(fileURLWithPath: urlString) let asset = AVAsset(url

invalid reference image arkit 1.5

二次信任 提交于 2019-12-06 22:35:49
问题 I am running the apple sample project of ARKit 1.5 Image detection but when I place my reference image inside AR Resource folder and run the app I get following error: Make sure all reference images are greater than 100 pixels and have a positive physical size in meters. I don't find any predefined requirements of how should the image be, can anyone explain the required attributes of the image? 回答1: As in Apple's documentation For each image, use the inspector to describe the physical size of

ARKit code issue {unknown error -1=ffffffffffffffff error: Task failed with exit 1}

妖精的绣舞 提交于 2019-12-06 22:28:28
I want to learn ARKit. I got apple's sample code and other sample codes in github. There is a error, Xcode reports: /Users/.../ARKitBasics-brwextbgckvaokheuvfoqkacalvx/Build/Products/Debug-iphoneos/ARKitBasics.app/Frameworks/libswiftARKit.dylib: unknown error -1=ffffffffffffffff error: Task failed with exit 1 signal 0 { /usr/bin/codesign '--force' '--sign' 'B8FBC6429C19D8DBEDBAC1BD044D6D4D7B68D1CF' '--verbose' '/Users/.../ARKitBasics-brwextbgckvaokheuvfoqkacalvx/Build/Products/Debug-iphoneos/ARKitBasics.app/Frameworks/libswiftARKit.dylib' I guess it is about libswiftARKit.dylib ,I don't know