arkit

How to draw dashed line in ARKit (SceneKit) like in the Measure app?

时间秒杀一切 提交于 2021-02-05 05:00:24
问题 Just wanted to know is it possible (I know it is, but how) to draw dashed line in ARSCNView like in the Measure app? Maybe there is a way to use scene nodes out of the box, idk. I've been using the SCNCylinder to draw a straight line and IDK is it possible to reuse it and adjust or we have to use a really different way to make the dashed line. import SceneKit class CylinderLineNode: SCNNode { private(set) var cylinder: SCNCylinder private(set) var positionA: SCNVector3 private(set) var

How to draw dashed line in ARKit (SceneKit) like in the Measure app?

蹲街弑〆低调 提交于 2021-02-05 04:59:06
问题 Just wanted to know is it possible (I know it is, but how) to draw dashed line in ARSCNView like in the Measure app? Maybe there is a way to use scene nodes out of the box, idk. I've been using the SCNCylinder to draw a straight line and IDK is it possible to reuse it and adjust or we have to use a really different way to make the dashed line. import SceneKit class CylinderLineNode: SCNNode { private(set) var cylinder: SCNCylinder private(set) var positionA: SCNVector3 private(set) var

ARKit line between two SCNNode

馋奶兔 提交于 2021-01-29 13:49:30
问题 it is possible to draw a line from an SCNNode to another and keep the line 'updated' when the user move around the device? In my scenario I have to ARImageAnchor and I would like to create a line between this two points. 回答1: I have a demo creating line between two node https://www.youtube.com/watch?v=YDUq7nfvXBc&feature=youtu.be if this is what u want u can comment below 来源: https://stackoverflow.com/questions/54463858/arkit-line-between-two-scnnode

ARKit – Pivot Point of 3D model is wrong

时间秒杀一切 提交于 2021-01-29 00:44:44
问题 I´m using Blender to export my models to dae and Xcode to import it to scn . But my problem is that the pivot point is totally wrong placed when I use it in my scene. The strange thing is that the pivot point is positioned right in the model viewer from SceneKit (even as scn ). The World Coordinates are all zeroed. 回答1: Group all the elements of your 3D model in Blender and move your pivot point for that group at a desired place. SceneKit always reads in a position of pivot point in 99.99%

ARKit – Pivot Point of 3D model is wrong

两盒软妹~` 提交于 2021-01-29 00:41:36
问题 I´m using Blender to export my models to dae and Xcode to import it to scn . But my problem is that the pivot point is totally wrong placed when I use it in my scene. The strange thing is that the pivot point is positioned right in the model viewer from SceneKit (even as scn ). The World Coordinates are all zeroed. 回答1: Group all the elements of your 3D model in Blender and move your pivot point for that group at a desired place. SceneKit always reads in a position of pivot point in 99.99%

ARKit : select what `ARImageAnchor` to track

ε祈祈猫儿з 提交于 2021-01-28 14:09:46
问题 I found out empirically that ARKit does not track more than 4 Image Anchors at the same time; setting maximumNumberOfTrackedImages to a number higher than 4 is ignored : With a dozen images markers in the frustum of the camera, ARKit detects them all and returns the corresponding ARImageAnchor s, however only 4 of them will have isTracked == true . I could not find any reference about this limitation in the Apple documentation, however it was mentioned in this medium post : [...] for now you

Hide area of an SCNMaterial

懵懂的女人 提交于 2021-01-28 09:19:53
问题 I'm using SceneKit and ARKit 1.5, once a surface has been mapped I apply a material to it. I would like to only show what's under the camera in a certain radius with an alpha effect. I want to keep the material static meaning that it does not move when the camera moves, only the radius shape will move. What kind of technique could I use for this ? ArCore by Google does this perfectly. Actual rendering: Desired Rendering: ARCore example: (click to see GIF) Thank you! 回答1: I would use a shader

how to re-render the scanned mesh content with realityKit's ARView?

只谈情不闲聊 提交于 2021-01-28 07:51:38
问题 I can modify the line color of the mesh using the following code. extension ARMeshClassification { var description: String { switch self { case .ceiling: return "Ceiling" case .door: return "Door" case .floor: return "Floor" case .seat: return "Seat" case .table: return "Table" case .wall: return "Wall" case .window: return "Window" case .none: return "None" @unknown default: return "Unknown" } } var color: UIColor { switch self { case .ceiling: return .red case .door: return .green case

ARKit place node where finger press is

谁说我不能喝 提交于 2021-01-25 07:23:18
问题 I am working on an ios app with ARKit and I am wondering how to create a node exactly where I press my finger on the screen but approximately 0.5m into the screen. I know I will have to take into account the orientation of the device but I am still very confused on where to begin. Any help would be great! Thanks. 回答1: The solution is simple. Add a your required node as a child node to the camera with position vector (0,0,1). Now, save the world position of that node you created and

Using ARKit anchor to place RealityKit Scene

為{幸葍}努か 提交于 2021-01-05 11:23:32
问题 I am currently struggling to add an RealityKit Scene to an ARKit anchor. As my previous question, it is not possible to directly add the RealityKit Scene to an ARKit Anchor Node. But how can I use the ARKit Anchor to place my Scene? For example, I want to find an object in the room, and depending on which object I found, I want to use different scenes and anchor them in the room depending on the recognised objects position. Thanks for the help. Current try: func makeUIView(context: Context) -