This content has been marked as final.
Show 3 replies
-
Re: If parent Node will be moved, childnodes will followed.
Ysee-kzsln Apr 16, 2018 5:28 AM (in response to Tina.NTT)You can wrap all nodes into a parent node by using the SceneKit Editor -> Scene Graph -> Add a child node and move them into the parent.
-
Re: If parent Node will be moved, childnodes will followed.
Tina.NTT Apr 16, 2018 8:42 AM (in response to Ysee-kzsln)I did. But when I use hitTest.first.node, the childnode will be touch, not all parts of the object.
Can you look at my code?
Here is my code when touching:
let location = recognizer.location(in: sceneView) var hitTestOptions = [SCNHitTestOption: Any]() hitTestOptions[SCNHitTestOption.boundingBoxOnly] = true let hit=sceneView.hitTest(location, options: hitTestOptions).first print("You're dragging") guard let selectedNode=(hit?.node) as SCNNode? else { return } let transform = arHitTestResult.last?.worldTransform let newPosition = float3((transform?.columns.3.x)!, ((transform?.columns.3.y)!), (transform?.columns.3.z)!) selectedNode.simdPosition = newPosition sceneView.scene.rootNode.addChildNode(selectedNode)
-
Re: If parent Node will be moved, childnodes will followed.
Tina.NTT Apr 16, 2018 8:14 PM (in response to Ysee-kzsln)I did it. Thank you so much.
-