2

我是一名熟悉 Ada、C、Obj.C (iOS) 和 C# 的开发人员。我想创建一个应用程序来显示有关我正在构建的机器人的一些数据。但是,我以前从未使用 Mac 库或 OpenGL 做过图形。

我想要实现的目标如下图所示。我已经测试了处理来创建一些东西。但是它太复杂了,对于这种应用程序来说,处理功能远非强大。如果不编写一些讨厌的代码,它甚至无法围绕其中心旋转一条线。

要求
绘图功能(例如相对于时间绘制的电压)、Google 地图 API、渐变、2D 动画、蒙版。

问题

  1. 我应该学习什么?这是否可以仅使用 Mac 库/框架来实现,还是应该使用 OpenGL?
  2. 最好用 Obj c 来做吗?还是java值得学习?带有这样的图形的 Java 有多好?这件事是,如果我使用 Obj C 进行编程,那么它就不是跨平台的。
  3. 你还有什么其他的建议吗?

稍后,我想添加一个谷歌地图来显示飞机的位置。所有数据都通过 Wifi 传输。10赫兹。

在此处输入图像描述

4

3 回答 3

0

这是有人用 opengl 和 js 做的一个线程:http ://www.jpct.net/forum2/index.php?topic=3076.0

  1. 是的,您可以在 opengl 中执行此操作,但您可以考虑使用 2d 渲染的 Cairo,可能更简单。这当然取决于您是否需要 3d 渲染。在 3d 渲染的情况下,OpenGL 可能是一个更好的选择,然后尝试将其融入 Cairo 系统。

  2. 如果你希望它是跨平台的,我个人会用 Java 或 Python 来做,但大多数语言都有 opengl 和 cairo 绑定。如果是 java 我建议尝试 LWJGL。

  3. 您还需要考虑使用什么 UI 框架,因为您可能需要按钮和所有的爵士乐。我个人喜欢 Qt,但 WPF 也相当不错。

在这里查看开罗文档:http ://cairographics.org/documentation/

此外,这里提出了这个问题,评论线程中有更多建议:http ://www.gamedev.net/topic/479476-how-would-you-program-a-pfd-primary-flight-display/

我不确定 cairo 的动画有多棒,但这里有一个教程证明:http ://cairographics.org/threaded_animation_with_cairo/

于 2013-04-07T22:28:13.433 回答
0

I dont think that some specific library will accomplish all the requirements. Probably you will need to use a mix of them.

If you ask me, Id go for a combination of web ui frameworks. Based on the image you have shared, im sure that most of that graphical components can be constructed using ExtJs framework (see these examples: http://www.sencha.com/products/extjs/examples/, http://docs.sencha.com/ext-js/4-2/extjs-build/examples/charts/Gauge.html, http://docs.sencha.com/ext-js/4-2/extjs-build/examples/sandbox/sandbox.html). For the central panel, maybe there is no library that provides a generic widget like that, and so I would go for a custom HTML5 Canvas implementation (http://en.wikipedia.org/wiki/Canvas_element).

Just want to add that I woudl go for the web way simply because:

  • Community is BIG for almost any library
  • Cross platform issues would not be a problem
  • 大多数 Web UI 框架都是成熟的,并且有开箱即用的小部件可供使用。
  • 使用网络与外部 API(如您提到的 Google 地图)进行通信是小菜一碟。
于 2013-04-07T22:59:26.330 回答
-1

Ah, this is personal experience I've had while I built my final year engineering project(which was incidentally a robot that could fly) - And I've built something like this before.

I used Java for graphing and telemetry data tool with flight display system like that(and it was sufficient).

But if you are good with a programming language, then you can do it in any language of your choice. Yes, Mac + OpenGL + ObjC is good combination too. My aim was to keep the code as portable as possible.

于 2013-04-07T22:42:44.990 回答