
@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*/
}
@IBAction func switchToDefaultCam(sender: AnyObject) {
gameView.makeCameraActive(scene.defaultCam)
}
}
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
it's not working as I'd like