I'm working on a SceneKit project in iOS, trying to rotate a sphere (representing a planet) so that a point at a given longitude/latitude coordinate is facing "forward" (i.e. that point moves to the {0,0} position). So for example, we're looking at Earth's {0,0} point, off the coast of Africa, but I need to know what rotation vector would have us looking at {37,-122}, aka San Francisco. Ideally, the planet would remain "naturally" oriented, with north remaining generally "up" from our perspective, but that's flexible.
I've got the animation working and I can rotate to a given longitude OR latitude using SCNVector4, but as soon as I try to rotate to a given longitude AND latitude, it gets wildly messed up. So I've been doing some research, and I've found some resources that seem to do exactly what I need, but to be honest they're a bit beyond me. I'm a complete newbie in the world of trigonometry and matrices, and it seems there's no way around this problem without them.
Can anyone help me understand how these concepts can take long/lat coordinates, and calculate a rotation vector? A method for creating a SCNVector4 would be perfect, but even just help with calculating the components individually would be greatly appreciated!
rotation
property using either. \$\endgroup\$