I am working on an Augmented Reality (AR) app for an Android phone. I would like to display my orientation data in the form of two rotating axes: one at the top of the screen to show the current azimuth (North, East, South, West), and one on the side to show the altitude/elevation. I’m new to Android programming, so I’m not really sure how to go about creating these axes visually.
My first thought was that I could use predefined images that somehow wrap around upon hitting the edges of the screen (as if the image was on the outside of a rotating cylinder). From here, it would be a simple matter of lining up the image with the information I’m pulling from the sensors.
Is there some way to wrap images so that they can be rotated in a virtual plane in this manner? Can anybody suggest a better solution to my original problem?
I’m pressed for time, so I’ve come up with a hard-coded solution that could probably be extended to a more general case without too much trouble. To create the axes, I’m programmatically generating a bunch of Path objects and then drawing them to my canvas. Then I simply translate the canvas back and forth based on the azimuth values I’m collecting.
Here is a copy of the class I use to generate the azimuth axis:
}