问题标签 [processing]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
793 浏览

processing - 如何将动画应用到三角形中(处理)

我想创建一个简单的动画,只能在特定区域显示,例如三角形。我已经有了动画,一个旋转的图片。但我不知道如何将其放入三角形中。函数 texture() 只能将图像应用到特定区域。还有其他方法吗?谢谢!

0 投票
1 回答
10573 浏览

android - 我应该如何每秒调用 30 次 Android 视图的 onDraw() 方法

对于 Android,我有一个自定义视图,我在 onDraw() 方法中填充了原始形状。

来自处理背景,我希望绘图方法每秒自动调用 30 次,但很明显这不是 android 视图的工作方式。

那么我应该如何每秒调用这个方法 30 次呢?

0 投票
1 回答
760 浏览

opengl - 解释处理中的 TexturedSphere 示例

Processing项目网站上有一个实现具有旋转功能的3D 纹理球体的示例。我正在尝试理解代码,但由于我没有图形背景,所以我无法理解许多代码块。

对每个块试图完成的任何更高级别的解释,也许是参考相关算法,都可以让我阅读概念并更好地理解实现。

0 投票
2 回答
298 浏览

java - 如何操作类似于 SQL 中的 ORDER BY 子句的数组?

我的数据已被放入一个数组中,但不幸的是不是按照我想要的顺序...

我如何操作这个数组,以便当我循环遍历它时,顺序是数量,类似于SELECT * FROM "databaseToArray" ORDER BY "Amount"aka

0 投票
1 回答
1262 浏览

java - 如何通过添加路径来动态构造 3d 对象?(Java;OpenGL)

所以我有一些路径生成器现在像这样工作

http://www.openprocessing.org/visuals/?visualID=2615(有源码;WQRNING - JAVA 小程序)

我想使用我生成的路径创建一些 3D 对象,因此它锁定在类似于我现在在 2D 中获得的视角之一。

那么如何通过添加路径来动态构建 3D 对象呢?

顺便说一句:实际上我提到了这样的算法http://www.derschmale.com/2009/07/20/slice-based-volume-rendering-using-pixel-bender/

所以我想从这样的 PATH 中创建(我不想使用图像,也不想使用 flash 我想使用 Java + OpenGl)

替代文字

这样的 3d 图像(但请注意,我想要 openGL Java 和 Path 的))

替代文字

0 投票
1 回答
325 浏览

java - 如何在 P2D 模式下绘制完全透明的像素/点?

根据Processing Referencestroke(gray, alpha)允许设置描边的颜色和不透明度。在默认颜色模式下,alpha 值 255 表示完全不透明,而值 0 应对应于完全透明。虽然这适用于(默认)JAVA2D 渲染器,但我似乎无法在 P2D 模式下绘制完全透明的点。

这段代码清楚地在画布的中心渲染了一个像素,即使 alpha 值设置为 0(完全透明):

}

这里有什么问题?

0 投票
3 回答
4007 浏览

java - Using R in Processing through rJava/JRI?

Is it possible to run R in Processing through rJava/JRI? If I deployed a Processing app on the web, would the client need R on their system?

I'm looking to create an interactive information dashboard that I can deploy on the web. It seems that Processing is probably my best bet for the interactive/web part of things. Unfortunately, it doesn't look like there are many math/stats functions built-in. And there aren't any libraries for plotting data either.

I've been using R and gpplot2 for a few months and am thrilled (amazed) at how easily it manipulates and plots data.

So I'm wondering now if can get the best of both worlds and run R through a Processing applet.

From the JRI website:

JRI is a Java/R Interface, which allows to run R inside Java applications as a single thread. Basically it loads R dynamic library into Java and provides a Java API to R functionality. It supports both simple calls to R functions and a full running REPL.

In a sense JRI is the inverse of rJava and both can be combined (i.e. you can run R code inside JRI that calls back to the JVM via rJava). The JGR project makes the full use of both JRI and rJava to provide a full Java GUI for R.

JRI uses native code, but it supports all platforms where Sun's Java (or compatible) is available, including Windows, Mac OS X, Sun and Linux (both 32-bit and 64-bit).

Thanks for the advice :)

0 投票
4 回答
28474 浏览

java - 如何在退出前保存应用程序选项?

我已经做了一个应用程序,我需要在退出之前保存一些选项。(像窗口尺寸,...,这将被写入一个文件。)

主框架设置了这个:

如何保存我感兴趣的选项?(当然在退出之前)

谢谢!

0 投票
1 回答
11674 浏览

processing - 使用处理创建正弦波线

第一篇在这里,可能是一个简单的。

我从 Processing 的参考站点获得了代码:

http://processing.org/reference/sin_.html

但是,我需要的是一条沿着 Sin 波曲线的线,而不是代表沿曲线的点并在 0 轴处结束的线。所以基本上我需要用正弦波方程画一个“S”形。

有人可以告诉我如何做到这一点吗?

提前谢谢你,-Askee

0 投票
5 回答
18076 浏览

processing - 在处理中从数组中删除对象的最佳方法

我真的希望Processing 有用于处理数组的pushpop方法,但由于它没有,我只能试图找出在数组中的特定位置删除对象的最佳方法。我确信这对许多人来说是最基本的,但我可以使用一些帮助,而且我无法通过浏览处理参考来弄清楚。

我认为这并不重要,但供您参考的是我最初用于添加对象的代码:

为了这个问题,假设我想从位置 15 移除一个对象。谢谢,伙计们。