-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement - Geocentric Horizon view / CelestialSphere of universe based off user location + date #46
Comments
these objective-c classes successfully map the lat / lng co-ordinates to an object in scenekit. |
fyi - @onekiloparsec |
I apologize for confusion as the words to describe what I want to do fail me. I need to do a drawing. so let me clarify this ticket - using CoreLocationManager - I can easily find true north as shown above from where I am. That's all easy stuff. This code goes one step further and indicates where the moon is in relation to the user. Not sure how to do the translation of the view - but if we can get the sun to align to the sun, That is the universal plane with planets would tilt accordingly to where they're actually spinning with respect to end user's location + date. This is called geocentric point of view. I reached out to the author of SwiftAA - Cédric Foellmi and he mentioned At a fixed given point in time (assuming you keep standard epoch and equinox, of course…), you still have to take care of Earth location, and make sure you check the (small) difference between geocentric (with Earth center as reference) and topocentric (Observer position as reference) positions. I think to do this - need to break apart into smaller tickets - so I added the ability to add lat / lng position according to scenekit node in other ticket. From digging into celestial spheres - I think this is what should be in place of the sun. Perhaps - a worthy SwiftAA side piece of work would be to create some code that can create a celestial sphere in arkit this would match up to user's current location and compass baring. I dug into flash animate code / but it's actionscript 1. bin job. This image is only helpful in that it helps illustrate a person inside sphere - that would align to earth's rotation / user's north. all the planets would fly around it using arkit. |
fyi - rotate earth to right time of day / scenekit + swift |
That's a quite old version of my "Geometries" testbed! |
instead of the cube - I will rework it to be planet earth. the top being current location. |
some progress - https://github.com/johndpope/solarSystem-1 Not sure what' necessary from scenekit - but I need the elliptical planes to be gymbal locked to earth. Currently in my code - when I rotate the sun - the planets continue merrily along their previous paths. when I adjust the earth, I need all the planets to adjust their planes accordingly. |
Similarly to coordinates conversion, obtaining the sidereal time is just a matter of converting the date (or JulianDay) to sidereal time, using the geographic coordinates. See the method |
maths for calculating geocentric position of planets. |
Still, SwiftAA provides everything you need to make these calculations. Probably with more accuracy than this web page. |
I believe SwiftAA needs an orrery for reference purposes this seems to be the flagship |
so digging through docs on swiftAA - the class Planet supposedly includes equatorialCoordinates. /// The coordinates of the object in the equatorial system (based on Earth equator), with the Earth's center as its origin.
public var equatorialCoordinates: EquatorialCoordinates {
get { return self.apparentGeocentricEquatorialCoordinates }
}
/// The heliocentric coordinates of the planet in the ecliptic system (based on planet orbits plane). That is, its apparent position on the celestial sphere, as
/// as it would be seen by an observer at rest at the barycenter of the solar system, and referred to the
/// instantaneous equator, ecliptic and equinox.
/// It accounts for 1) the effect of light-time and 2) the effect of the Earth motion. See AA p224.
public var heliocentricEclipticCoordinates: EclipticCoordinates {
get {
let longitude = KPCAAEclipticalElement_EclipticLongitude(self.julianDay.value, self.planet, self.highPrecision)
let latitude = KPCAAEclipticalElement_EclipticLatitude(self.julianDay.value, self.planet, self.highPrecision)
// Using standard epoch, thus standard value for the equinox, thus the mean obliquity.
return EclipticCoordinates(lambda: Degree(longitude), beta: Degree(latitude))
}
} |
I think for me to get this working - need to take a step back and build an armillary sphere - then drop it into ARKit. ITunes App |
I've spent some days digging through this - with this image - hopefully it will make sense.
https://youtu.be/9XHoVF2G0j8?t=653
http://astro.unl.edu/classaction/animations/coordsmotion/celestialhorizon.html
I think I'm looking to find a camera angle for scenekit which would create a horizon view to universe
I want to make the point of view geocentric.
the horizon which is currently the heliocentric plane - I want to tilt to the declination of earth's orbit - with every planet above the horizon above the scenekit floor / everything below the earth beneath. the universe plane would still spin as it does. (I'm not looking to create star walk - how the view is represented is perfect. )
Not sure how hard this is - I found this function that maybe able to be repurposed.
given a users location / instead of finding the moon - perhaps we can derive a camera angle in scenekit. the point of view - would be geocentric - as the user sees the planets above.
func findMoon(date: NSDate, longitude: Double, latitude: Double) -> (Double,Double,Double)
https://github.com/johndpope/Moon/blob/ui-heading-display/Moon/FindMoonService.swift
The text was updated successfully, but these errors were encountered: