ThumbWorks / AugmentedSolarSystem

An Augmented reality experience to explore planets in our Solar System
71 stars 25 forks source link

possible improvement on rendering #61

Open johndpope opened 6 years ago

johndpope commented 6 years ago

in this method - func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) { (this is called 60 x / second)

so check that a second has incremented before calculating changes to position.

func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) {
    guard let cameraNode = sceneView.pointOfView else {
        print("we got an update but we don't have a camera. No distance calculations can happen")
        return
    }

     let delta = (time - startTime) * 60 * 60 * 24
    //maybe as simple as if 
     if delta < 1 return

fyi - I'm making some progress with celestial sphere.

screen shot 2018-02-19 at 4 55 08 pm