Hello all,
I’m trying to create Google Starmap-like controls for a mobile game, and I’m starting to regret skipping my Linear Algebra lectures. It’s become clear to me after doing some research, that the camera’s rotation is determined based on the phone’s accelerometer and 3D compass. These two orthogonal vectors (and their orthogonal cross-product) define the “phone space” relative to “local earth space.” I want to take this rotation of coordinate systems and apply it to the scene camera in order to make the screen a “window” into the virtual world. I’ve already solved the problem of getting the compass data (boo Unity for not getting this internally
) but the best that I’ve come up with is a hack involving some dummy gimbal objects and the result of SensorManager.getOrientation() from the Android framework.
I know there are some Unity devs who know the math here, and I’m sure some users out there can also help, but my feeble uneducated brain can’t figure it out. Would anyone care to enlighten me?
Thanks in advance, and I was just kidding about the “boo Unity” part above. Writing the plugin took no time at all. Yaay Unity!
Thanks in advance for the help