如何显示风向?
我想创建某种图形箭头,或者可能在指南针上绘制箭头以向用户显示风来自哪个方向。考虑到用户手机的方向,这显然会改变。
我的应用程序可以告诉我风向来自哪个方向(以度为单位)。 我的问题是,实现这样的事情的最佳方法是什么?
谢谢
I want to create some sort of graphical arrow, or possibly draw an arrow over a compass to show the user what direction the wind is coming from. This would obviously change, given the orientation of the persons handset.
My application can tell me what direction (in degrees) the wind direction is coming from.
My question is, what is the best way to implement something like this?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Exclipse 中创建一个新的 Android 项目并选择“从现有示例创建项目”。选择目标 Android 版本,然后选择 ApiDemos。在那里您将找到一个指南针应用程序和许多其他可以帮助您绘制屏幕的示例。
我想最好的情况是你的风箭是 3D 或模拟 3D 的,这样用户如何握住他的设备并不重要,因为他总是从升高的虚拟复古点观看风箭。
在同一个 ApiDemos 中还有“传感器”演示,它绘制设备的物理方向。
In your Exclipse create a new Android project and select "Create project from existing sample". Choose target android version and then ApiDemos. There you will find a Compass application and many other examples which can help you draw your screen.
I guess the best would be if your wind arrow would be in 3D or simulated 3D, so that it does not matter how the user is holding his device, for he would always look at the wind arrow from an elevated virtual vintage point.
In the same ApiDemos there is also "Sensors" demo which draws the physical orientation of the device.
然后询问用户是否对这个设置感到满意,如果不满意,为什么,改进等等。但是从非常简单的事情开始,就像上面的那样。
Then ask users whether they are happy with this setup, if not, why, improve, etc. But start with something dead simple, like the above.