arkit

How to record video from ARKit?

孤街浪徒 提交于 2019-12-20 10:19:33
问题 Now I'm testing ARKit/SceneKit implementation. The basic rendering to the screen is kinda working so then I wanna try recording what I see on the screen into a video. Just for recording of Scene Kit I found this Gist: // // ViewController.swift // SceneKitToVideo // // Created by Lacy Rhoades on 11/29/16. // Copyright © 2016 Lacy Rhoades. All rights reserved. // import SceneKit import GPUImage import Photos class ViewController: UIViewController { // Renders a scene (and shows it on the

How to track image anchors after initial detection in ARKit 1.5?

十年热恋 提交于 2019-12-20 09:23:14
问题 I'm trying ARKit 1.5 with image recognition and, as we can read in the code of the sample project from Apple: Image anchors are not tracked after initial detection, so create an animation that limits the duration for which the plane visualization appears. An ARImageAnchor doesn't have a center: vector_float3 like ARPlaneAnchor has, and I cannot find how I can track the detected image anchors. I would like to achieve something like in this video, that is, to have a fix image, button, label,

Is it possible to track objects in ARKit like in Vuforia?

天大地大妈咪最大 提交于 2019-12-20 09:13:23
问题 I couldn't find any information if Apple's ARKit supports 3D object tracking (or even image tracking) like Vuforia does. I don't want to place a 3D model just anywhere in the world. Instead I want to detect a specific 3D object and place AR objects in front and on top of that object. Simple example: I want to track a specific toy car in the real world and add a spoiler on top of it in the AR scene. Can someone provide me information wether that is possible or not? 回答1: Update for iOS 12: In

ARKit setting WorldTrackingConfiguration to gravityAndHeading produces error

懵懂的女人 提交于 2019-12-20 06:19:29
问题 I am trying to use the .gravityAndHeading on my ARWorldTrackingConfiguration.worldAlignment configuration. However, I keep getting this error: Device orientation error: Error Domain=CMErrorDomain Code=102 "(null)" 2018-03-01 20:08:25.218445+0000 App[759:84092] [Session] Session (0x10ba12ce0): did fail with error: Error Domain=com.apple.arkit.error Code=102 "Required sensor failed." UserInfo={NSLocalizedFailureReason=A sensor failed to deliver the required input., NSUnderlyingError=0x1c0850740

Why does ARKit app stop working after a few days?

醉酒当歌 提交于 2019-12-20 05:28:15
问题 I developed a simple ARKit app in Unity for iOS. It works great, but there is a strange problem: after several days it stops working. So when I click on the app icon on the iPhone, it opens the app for a millisecond and instantly quits. If I reinstall the app again it works perfectly as before. Why is it happening? Is there any way to prevent it? I use "Personal team" in Xcode, can it be the reason? Thank you in advance! 回答1: Unlike in Android, you can’t install any app on an iOS device. It

Face texture from ARKit

这一生的挚爱 提交于 2019-12-20 03:09:49
问题 I am running a face tracking configuration in ARKit with SceneKit, in each frame i can access the camera feed via the snapshot property or the capturedImage as a buffer, i have also been able to map each face vertex to the image coordinate space and add some UIView helpers(1 point squares) to display in realtime all the face vertices on the screen, like this: func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor) { guard let faceGeometry = node.geometry as?

How to generate USDZ file again from ZIP file?

冷暖自知 提交于 2019-12-19 11:31:56
问题 Hello everyone I'm trying to unzip a USDZ file, modify a texture, and then zip the USDZ file again, but it breaks. Is there any special way to zip the file back? Even if I decompress and compress again it stops working and has different file size. I'm using no compression and no encryption to zip the file. One thing I have noticed is that the attribute "Needed to extract" for the USDZ file is "2.0 or later" while my new zip file value is "1.0 or later". Also the files in the original USDZ zip

ARKit - Applying Force in User's Phone Direction

徘徊边缘 提交于 2019-12-19 10:18:03
问题 I have the following code that creates a SCNBox and shoots it on the screen. This works but as soon as I turn the phone in any other direction then the force impulse does not get updated and it always shoots the box in the same old position. Here is the code: @objc func tapped(recognizer :UIGestureRecognizer) { guard let currentFrame = self.sceneView.session.currentFrame else { return } / let box = SCNBox(width: 0.2, height: 0.2, length: 0.2, chamferRadius: 0) let material = SCNMaterial()

Scenekit shape between 4 points

∥☆過路亽.° 提交于 2019-12-19 10:11:09
问题 Given that the route I was taking in a previous question: ARKit - place a SCNPlane between 2 vector points on a plane in Swift 3 ...seems to be flawed, I'm looking at other options. I can draw a line between 2 nodes, I can then create nodes above those, effectively in a square but even if I draw lines between them all, I can't make that into a shape. Is it possible in Scenekit to draw a shape (square) where each of the 4 corners joins to a node. I can create a plane, position it on a node,

Adding a material to a ModelEntity programmatically

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-19 04:14:14
问题 The docs for RealityKit include the structs: OcclusionMaterial , SimpleMaterial , and UnlitMaterial for adding materials to a ModelEntity . Alternatively you can load in a model with a material attached to it. I want to add a custom material/texture to a ModelEntity programmatically. How can I achieve this on the fly without adding the material to a model in Reality Composer or some other 3D software? 回答1: Updated : 21st October 2019 . As you said, there are 3 types of materials in RealityKit