1

I am trying to covert the latitude and longitude to a SCNVector3 format. I found this article: http://www.mathworks.com/help/aeroblks/llatoecefposition.html

But not sure how to move forward. Any ideas.

UPDATE:

 let resturant = Resturant(latitude: 29.963221, longitude: -95.498958)

 let x =  ((self.sceneView.bounds.width/360.0) * (CGFloat(180.0 + resturant.latitude)));
        let y =  ((self.sceneView.bounds.height/180.0) * (CGFloat(90.0 - resturant.longitude)));

        let cube = SCNBox(width: 0.2, height: 0.2, length: 0.2, chamferRadius: 0)
        let material = SCNMaterial()
        material.diffuse.contents = UIColor.red

        cube.materials = [material]

        let node = SCNNode(geometry: cube)
        node.position = SCNVector3(x,2,-5)

        scene.rootNode.addChildNode(node)

        // Set the scene to the view
        sceneView.scene = scene
john doe
  • 9,220
  • 23
  • 91
  • 167

0 Answers0