arkit

SCNLevelOfDetails delegate/notification

时光毁灭记忆、已成空白 提交于 2020-01-16 14:35:40
问题 I'm using SCNLevelOfDetails with SceneKit. I was wondering if there's a way to know when the engine changes the levelOfDetails for a particular node's geometry. Many thanks. 回答1: I'm answering my own question. To give more context, we needed to know when the LOD would change in order to stop an idle animation, our model is skinned. What happens if you don't disable this animation when the LOD changes is that the geo goes all over the place and it looks wrong. The solution for us was to clone

SCNLevelOfDetails delegate/notification

吃可爱长大的小学妹 提交于 2020-01-16 14:35:27
问题 I'm using SCNLevelOfDetails with SceneKit. I was wondering if there's a way to know when the engine changes the levelOfDetails for a particular node's geometry. Many thanks. 回答1: I'm answering my own question. To give more context, we needed to know when the LOD would change in order to stop an idle animation, our model is skinned. What happens if you don't disable this animation when the LOD changes is that the geo goes all over the place and it looks wrong. The solution for us was to clone

Recalculate SCNNode geometry based on transformation

早过忘川 提交于 2020-01-16 09:12:40
问题 Is there a way to solidify a SCNNode scale and orientation by recalculating its geometry? Basically I am loading a SCNNode out of a scn file that was converted from a sketchup file that was exported to a DAE file. Because ARKit works in meters and with a different axis orientation I have to set the loaded SCNNode’s scale (to 0.0254) and eulerangle (x -90deg) to correctly show it. This all works fine however thus scaling and rotation messes up some logic down the line because this logic also

How do I rotate an object around only one axis in RealityKit?

痴心易碎 提交于 2020-01-16 06:22:58
问题 I'm trying to rotate a cube around its z-axis but I can't find how. Is there a way in RealityKit to do this? 回答1: In RealityKit there are, at least, two ways to rotate object around single axis : First approach: let boxAnchor = try! Experience.loadBox() boxAnchor.steelBox?.orientation = simd_quatf(angle: .pi/4, /* 45 Deg in Rad */ axis: [0, 0, 1]) /* Around Z axis */ Second approach: boxAnchor.steelBox?.transform = Transform(pitch: 0, yaw: 0, roll: .pi/4) /* Around Z axis */ pitch is X axis

How Can I integrate Unity-Build App with native iOS App?

无人久伴 提交于 2020-01-16 01:17:10
问题 is there a way to include the Unity-Build app in a view controller's view ? I was following this tutorial : https://medium.com/@IronEqual/how-to-embed-a-unity-game-into-an-ios-native-swift-app-772a0b65c82 it was working fine with the Unity apps that don't include ARKit Plugin, but after adding ARkit to the app, I get this Building error : Desktop/SwiftTut/SwiftTut/Unity/Classes/Native/Bulk_mscorlib_10.cpp:15950:81: No member named ‘Contexts’ in namespace ‘il2cpp::icalls::mscorlib::System:

Error “OBJ file has no faces”

一曲冷凌霜 提交于 2020-01-15 09:57:26
问题 I want to place an obj-3D-Model with ARKit and SceneKit. That's the model I'm using: https://free3d.com/3d-model/chest-50529.html I'm using the following code: private func createChestFromScene(_ position: SCNVector3) -> SCNNode? { guard let url = Bundle.main.url(forResource: "art.scnassets/Models/chest", withExtension: "obj") else { NSLog("Could not find door scene") return nil } guard let node = SCNReferenceNode(url: url) else { return nil } node.load() // Position scene node.position =

Swift ARKit How do you fully kill an ARSession?

烂漫一生 提交于 2020-01-14 10:23:53
问题 I have an ARSCNView running an ARSession . You can pause the session with session.pause() sure, but that still in effect, leaves the session running. I have tried deallocating the ARSCNView by removing it from its superview. The ARSCNView indeed deallocates but the ARSession is still running afterwards!! You can't assign nil to ARSession either. I can see the ARSessionDelegate 's func session(_ session: ARSession, didUpdate frame: ARFrame) is still being called! How do you completely wipe the

Swift ARKit How do you fully kill an ARSession?

北慕城南 提交于 2020-01-14 10:23:11
问题 I have an ARSCNView running an ARSession . You can pause the session with session.pause() sure, but that still in effect, leaves the session running. I have tried deallocating the ARSCNView by removing it from its superview. The ARSCNView indeed deallocates but the ARSession is still running afterwards!! You can't assign nil to ARSession either. I can see the ARSessionDelegate 's func session(_ session: ARSession, didUpdate frame: ARFrame) is still being called! How do you completely wipe the

Swift ARKit How do you fully kill an ARSession?

房东的猫 提交于 2020-01-14 10:22:48
问题 I have an ARSCNView running an ARSession . You can pause the session with session.pause() sure, but that still in effect, leaves the session running. I have tried deallocating the ARSCNView by removing it from its superview. The ARSCNView indeed deallocates but the ARSession is still running afterwards!! You can't assign nil to ARSession either. I can see the ARSessionDelegate 's func session(_ session: ARSession, didUpdate frame: ARFrame) is still being called! How do you completely wipe the

Unable to rotate an SCNNode in ARKit

末鹿安然 提交于 2020-01-14 00:30:13
问题 I'm trying to rotate an SCNNode on the y-axis so my node (an arrow) points in the right direction. I want to make a navigation app that uses ARKit; each arrow needs to point to the next location of the route I have received. The retrieval of the route works properly. The nodes are added to the rootNode of the scene. At some point I traverse an array of nodes to position them in the scene and apply scaling to the node (based on the distance), which is all done correctly. However, when I apply