ThumbWorks / AugmentedSolarSystem

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

enhancement - additional cameras points of view #54

Open johndpope opened 6 years ago

johndpope commented 6 years ago
screen shot 2017-11-20 at 10 51 03 am

@IBAction func switchToDefaultCam(sender: AnyObject) { gameView.makeCameraActive(scene.defaultCam) }

@IBAction func switchToShoulderCam(sender: AnyObject) {
    gameView.makeCameraActive(scene.playerCam)
}

@IBAction func switchToSkyCam(sender: AnyObject) {
    gameView.makeCameraActive(scene.skyCam)
}

@IBAction func switchToCoffeeCam(sender: AnyObject) {
    gameView.makeCameraActive(scene.coffeeCam)

}

getting the geocentric point of view working - it occurred to me that people could potentially want to change their point of view to anywhere in the universe.

having a variety of camera positions could be useful to toggle interstellar points of views (while allowing arkit to do it's thing with point of view).

some views I'm looking to create

etc

thus far I have this https://github.com/johndpope/solarSystem-1/tree/master/SolarSystem

    // |_   cameraHandle
    //   |_   cameraOrientation
    //     |_   cameraNode

it's not working as I'd like

 func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) {

        focusOnEarth()
    }

    func focusOnEarth(){

        if (cameraNode != sceneView.pointOfView){
            print("👀 - making cameraNode the sceneView.pointOfView ")
            sceneView.pointOfView = cameraNode
        }

        if let cc = camCoords.getCameraCoordinates(sceneView: sceneView){
           cameraHandle.position = SCNVector3(cc.x, cc.y, cc.z - 1)
        //  sceneView.scene.rootNode.addChildNode(node)
        }

        //        print("earth position:",earth?.position)
        var pos = earth?.position
        pos?.z = -1
        cameraHandle.position = pos!
        sceneView.pointOfView?.position = cameraHandle.position
        sceneView.pointOfView?.rotation = cameraHandle.rotation

        //        sceneView.pointOfView?.position = zoomedOutEarthCameraPosition!
        /*sceneView.pointOfView?.position = cameraHandle.presentation.position
         sceneView.pointOfView?.rotation = cameraHandle.presentation.rotation
         sceneView.pointOfView?.orientation = cameraHandle.presentation.orientation*/
    }
rodericj commented 6 years ago

Oh I see. You are in the debugging project not the ARKit project. Your gh issues are making a little more sense now.

johndpope commented 6 years ago

I hadn't considered needing a telescopic view point - but I guess if you're going to change the camera around the universe makes sense.

screen shot 2017-12-02 at 10 24 51 pm

johndpope commented 6 years ago

celestia can change camera angles to any point on planet / moon / solar system.

screen shot 2018-02-28 at 11 26 06 am screen shot 2018-02-28 at 11 28 34 am