开放框架与处理 [英] openFrameworks vs Processing

查看:65
本文介绍了开放框架与处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了很多关于 openFrameworks 和 Processing 的书,但仍然无法区分,除了一个是在 C++ 中,另一个是在 Java 中.谁能告诉我哪个是为了什么?

解决方案

你说得对,一个是 C++,另一个是 Java,这些差异适用于这些框架,所以由你的偏好/项目范围决定哪个一个最适合你.

使用处理:

这些是我现在想到的一些事情,可能还有更多.

就我个人而言,我发现在 Processing 中编写真正基本的一次性原型更容易.对于速度不是主要决定因素的情况,Processing 做得很好,但在其他情况下,我会将 Processing 原型移植到 openFrameworks(大多数情况下这很容易做到).

一个例子是涉及音频的应用程序,无论是分析还是合成.根据复杂性,Java Garbage Collector 会在您最不期望的时候进行清理,并在您需要响应时引起烦恼.

简而言之,两者都非常酷,但openFrameworks更快.不过,您可以通过自己管理内存来支付这种速度.

就在线部署而言,它确实取决于项目:如果是一个简单的项目,就与其他 js 库的集成而言,p5.js 可能是最简单的.oF 导出对于手动移植到 JavaScript 需要很长时间的大型复杂代码很方便,但请记住 Emscripten 项目将很大(例如 opencvExample 为 17.5MB)(因此不是蜂窝友好),您仍然需要添加自己的 JS -> C++ 绑定,如果您需要从网页调用 oF 应用程序函数.

另外,如果您对 C++ 感兴趣,您可能还想看看 libcinderPolycode.

HTH

I have been reading a lot about openFrameworks and Processing, But still can't make the distinction other than one is in C++ and the other in Java. Can someone tell me which is for what exactly?

解决方案

You are correct, one is C++ and the other is Java, and those differences apply to these frameworks, so it's up to your preferences/project scope to decide which one is best for you.

With Processing:

  • You get a minimal IDE, but can easily use Eclipse or other Java IDEs.
  • You get memory management (garbage collection)
  • You can publish applets online(via Java Applet or 'slimmed down' javascript ports using Canvas 2D with processingjs or p5js) or desktop applications for Linux/OSX/Windows (via Java Runtime). Note that versions newer than Processing 1.5.1 no longer export applets. That can still be done via command line or using eclipse.
  • You can publish to Android and (with 3rd party tools) to iPhone using iProcessing or the faster P5Nitro and more recently on Raspberry PI
  • You get almost 200 Libraries to extend its functionality.
  • You have support from the forums, quite a few books and online 'playgrounds' like OpenProcessing, SketchPatch, hascanvas or SketchPad.

With OpenFrameworks:

  • You choose your IDE (XCode on OSX, Code::Blocks, VC++)
  • You can manage your own memory (malloc, pointers and all that joy), but with modern C++ it's not necessary.
  • You can publish your project as a native application (no runtime needed)
  • You can not currently easily publish online, but this might change in the future(see Arturo Castro's of-emscripten progress)You can publish online using emscripten.
  • You can publish to the iPhone, as of OF 007 to Android and OF 0.8.0 to armv6 and armv7 devices such as Raspberry PI or Pandaboard
  • You get over 2000 Addons (not all are maintained) to extend its functionality.
  • You have support from the very active and helpful forums and can read about it in this online book or on a paper book or two.

These are some of the things the came to mind right now, there could be more.

Personally, I found it easier to write really basic throw-away prototypes in Processing. For situations where speed isn't a major decision factor, Processing does just well, but in other cases, I'd port the Processing prototypes to openFrameworks (which is easy to do most of the time).

An example would be application involving audio, be it analysis or synthesis. Depending on the complexity, the Java Garbage Collector would do a sweep when you least expect it and cause annoyances when you need responsiveness.

In short, both are really cool, but openFrameworks is faster. You pay for that speed by managing memory yourself though.

In terms of deploying online, it really depends on the project: if it's a simple project, probably p5.js might be easiest in terms of integration with other js libraries. The oF export is handy for big bulky complex code that would take too long to manually port to JavaScript, but bare in mind the Emscripten project will be large (e.g. 17.5MB for opencvExample) (and thus not cellular friendly) and you will still need to add your own JS -> C++ bindings if your need to call oF app function from the webpage.

Also, if you're interested in C++, you might want to also have a look at libcinder or Polycode.

HTH

这篇关于开放框架与处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆