augmented-reality

Event listeners in ar.js

你说的曾经没有我的故事 提交于 2021-01-19 10:29:50
问题 I am developing a project which involves ar.js that is displaying 3d objects and text to teach children the alphabet on both mobile devices and laptops. I was trying to add an event listener as an extra to make the children interact more. My target is to click/touch on the model displayed and it will enlarge or change color or rotation. Attached find my code. Hopefully you could solve my issue. HTML Code <!DOCTYPE html> <html> <head> <script src = "https://aframe.io/releases/1.0.3/aframe.min

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) -

How to calculate quadrangle for visible part of vertical plane?

三世轮回 提交于 2020-12-31 01:33:54
问题 My goal is to calculate the "visible" part of vertical plane that is anchored to some ARPlaneAnchor and represent it with quadrangle as shown in the picture below: My current approach is based on few hit tests, which unfortunately seems to not giving me the satisfying results. First, when I detect a ARPlaneAnchor I add a big invisible SCNNode to its main node. func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor) { guard let planeAnchor = anchor as?

Adding 3D object to ARGeoAnchor

拥有回忆 提交于 2020-12-13 05:40:08
问题 Please forgive me if this question is not that great. I've hit a bit of a road block on Apple's documentation of ARGeoAnchor. Currently ARGeoAnchor just shows a blue dot in the AR Scene View. I'm trying to show any 3d rendereing or object instead. My code: let coordinate = CLLocationCoordinate2D(latitude: lat, longitude: lng) let geoAnchor = ARGeoAnchor(name: "Point 1", coordinate: coordinate) let boxGeometry = SCNBox(width: 0.1, height: 0.1, length: 0.1, chamferRadius: 0) let cube = SCNNode

Android compass accuracy - when to calibrate?

情到浓时终转凉″ 提交于 2020-12-08 07:21:20
问题 I develop an application which provides some augmented reality features using compass. I found out that sometimes I need to calibrate my compass to make it work well. How do I know (programatically) that calibration is needed? I mean I know how to calibrate compass using the 8-pattern figure, but I want to detect that calibration is needed and display some alert to user ("Your compass is not accurate enough, please calibrate your compass sensor."). Is this possible, please? Thanks! 回答1: My

What is the difference between Orientation and Rotation in SCNNode

天大地大妈咪最大 提交于 2020-12-06 06:35:22
问题 I am quite confused by the "rotation" and "orientation" for a SCNNode. In Apple's doc, they are defined quite similarly: orientation: The node’s orientation, expressed as a quaternion. Animatable. rotation: The node’s orientation, expressed as a rotation angle about an axis. Animatable. And apple doc says: The rotation, eulerAngles, and orientation properties all affect the rotational aspect of the node’s transform property. Any change to one of these properties is reflected in the others. So