AugmentedSolarSystem icon indicating copy to clipboard operation
AugmentedSolarSystem copied to clipboard

enhancement - additional cameras points of view

Open johndpope opened this issue 8 years ago • 3 comments

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

  • earth street view / 1st person / horizon this requires a tilt calculation https://github.com/op1000/EarthTravel/blob/master/EarthTravel/Classes/EarthTravelViewController.m#L1045

  • Saturn street view one call thing would be to transport user to Saturn and to be able to see many moons flying above.

  • Saturn moons

  • earth azimuth / user's current location

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

johndpope avatar Nov 20 '17 16:11 johndpope

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

rodericj avatar Nov 20 '17 17:11 rodericj

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 avatar Dec 03 '17 03:12 johndpope

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

johndpope avatar Feb 28 '18 16:02 johndpope