arkit

Is there any way to load FBX file using ARKit?

假装没事ソ 提交于 2020-07-05 10:46:28
问题 In my project I am projecting 3d files using ARKit. I am able to project Dae and Obj format models. Is there anyway I could load fbx files? 回答1: ARKit itself isn't loading models in 3D scene. It's a work for a SceneKit framework. SceneKit doesn't directly support .fbx now. You could implement a reading of .fbx file format via ModelIO but it's non-trivial thing. The best way to prepare your model for working in ARKit, SceneKit and RealityKit is to convert it into usdz file format via new

How to detect the 2D images using ARKit and RealityKit

爷,独闯天下 提交于 2020-07-03 10:08:55
问题 I want to detect the 2D images using ARKit and RealityKit . I don't want to use SceneKit because many implementations based on RealityKit. I couldn't find any examples detecting images on RealityKit. I referred https://developer.apple.com/documentation/arkit/detecting_images_in_an_ar_experience sample code from apple. It uses Scenekit and ARSCNViewDelegate let arConfiguration = ARWorldTrackingConfiguration() arConfiguration.planeDetection = [.vertical, .horizontal] arConfiguration

SceneKit AR game fps getting low and the device getting hot with use

三世轮回 提交于 2020-06-27 16:16:42
问题 I'm developing a 3D game with ARKit and SceneKit. The game running smoothly at 60 fps but when I keep using it for a while the device get hot and the frame rate drop to 30 fps. The energy impact is very high and I noticed something in Instruments. I'll show the statistics and what I see in Instruments. This are the statistics when the game is running smoothly but I don't understand why I get 1.16K as the nodes count. I actually don't use so much nodes but it's just a simple level. This is

SceneKit AR game fps getting low and the device getting hot with use

徘徊边缘 提交于 2020-06-27 16:16:27
问题 I'm developing a 3D game with ARKit and SceneKit. The game running smoothly at 60 fps but when I keep using it for a while the device get hot and the frame rate drop to 30 fps. The energy impact is very high and I noticed something in Instruments. I'll show the statistics and what I see in Instruments. This are the statistics when the game is running smoothly but I don't understand why I get 1.16K as the nodes count. I actually don't use so much nodes but it's just a simple level. This is

ARKit: Finding the coordinates of a SCNNode on the screen

℡╲_俬逩灬. 提交于 2020-06-27 08:17:17
问题 I have a simple Swift ARKit setup where I have a SCNNode with a 3D object that is visible in an ARSCNView. I want to determine the 2D coordinates of this object on the ARSCNView. By this I mean the x- and y-coordinates the object has when it is drawn onto the screen. I have provided a sketch to illustrate what I mean: Is there a way to get these coordinates, or at least an approximation? I need this in order to do some further processing with the camera frame. Basically I am interested in the

Dynamically change text of RealityKit entity

时间秒杀一切 提交于 2020-06-25 06:45:33
问题 I have created a very simple scene ("SpeechScene") using Reality Composer, with a single speech callout object ("Speech Bubble") anchored to a Face anchor. I have loaded this scene into code via the following: let speechAnchor = try! Experience.loadSpeechScene() arView.scene.anchors.append(speechAnchor) let bubble = (arView.scene as? Experience.SpeechScene)?.speechBubble It renders as expected. However, I would like to dynamically change the text of this existing entity. I found a similar

Multi-face detection in RealityKit

允我心安 提交于 2020-06-25 05:44:28
问题 I have added content to the face anchor in Reality Composer, later on, after loading the Experience that i created on Reality Composer, i create a face tracking session like this: guard ARFaceTrackingConfiguration.isSupported else { return } let configuration = ARFaceTrackingConfiguration() configuration.maximumNumberOfTrackedFaces = ARFaceTrackingConfiguration.supportedNumberOfTrackedFaces configuration.isLightEstimationEnabled = true arView.session.delegate = self arView.session.run

ios - ARKit - How to create rotate object gesture function?

这一生的挚爱 提交于 2020-06-24 05:26:22
问题 I'm new in ARKit. I want to create a function to rotate object. This is my code about drag and rotate object: // Rotate object @objc func rotateRecognized(sender: UIPanGestureRecognizer) { let sceneView = sender.view as! ARSCNView let swipeLocation = sender.location(in: sceneView) let hitTest = sceneView.hitTest(swipeLocation) if !hitTest.isEmpty { sender.minimumNumberOfTouches = 2 let results = hitTest.first! let node = results.node let xPan = sender.velocity(in: sceneView).x/10000 node

Set UIView as SCNMaterial content

孤人 提交于 2020-06-17 15:58:10
问题 I'm trying to use a UIView with Arkit 3D space. I've seen a few examples which requires the UIView or UIView's layer is set as the diffuse content of the SCNMaterial object. That's not working as I've expected so far. I only see the frame of the view but the subviews within it are not added neither is a corner radius on the layer visible. func setupBillBoard() { let view = PlayerView(frame: CGRect(x: 0, y: 0, width: 70, height: 40)) view.backgroundColor = .red view.layer.cornerRadius = 14 let

Swift: Accessing the 1220 face vertices and save the vertices from AR face

旧时模样 提交于 2020-06-16 18:12:33
问题 I am trying to get the 1220 vertices data and save them to the iPhone file. The problem I am having is I could not get the captured data and write them into the JSON structure correctly. I have: struct CaptureData { var vertices: [SIMD3<Float>] var verticesFormatted : String { let v = "<" + vertices.map{ "\($0.x):\($0.y):\($0.z)" }.joined(separator: "~") + "~t:\(String(Double(Date().timeIntervalSince1970)))>" return "\(v)" } var jsonDict:Dictionary<String, Any> = [ "facetracking_data" : "1",