Skip to content

enhancement - additional cameras points of view #54

@johndpope

Description

@johndpope

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*/
   }
   

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions