0

I am able to add a box by given it a position of my first point but its not covering my second point, see attached image of my out put.

Here is the code i am using:

    boxLine = SCNBox(width: 0.01, height: CGFloat(distance+distance), length: 0.01, chamferRadius: 0.01)
    boxLine.firstMaterial!.diffuse.contents = UIColor.red
    boxLineNode = SCNNode(geometry: boxLine)
    boxLineNode.position = SCNVector3Make(start.x, start.y, start.z)
    sceneView.scene.rootNode.addChildNode(boxLineNode)

enter image description here

Satish Mavani
  • 4,897
  • 2
  • 20
  • 30
  • 1
    See also [this question](https://stackoverflow.com/questions/30190171/scenekit-object-between-two-points) and [this one too](https://stackoverflow.com/questions/21886224/drawing-a-line-between-two-points-using-scenekit). Many possible questions about using SceneKit in AR aren’t specific to AR. SceneKit has been shipping on macOS since 2012 and iOS since 2014, so there are lots of useful resources out there already, including questions and answers here on stack overflow. – rickster Jul 07 '17 at 17:33
  • thanks @rickster I am totally new to scene kit too, So when i am trying to use this solution getting many errors can you please help me with it? May be its because i want it in swift 4. – Satish Mavani Jul 08 '17 at 07:29

0 Answers0