processing

Baking the arrays on screen with Processing

蹲街弑〆低调 提交于 2021-02-08 10:32:40
问题 I like working with Processing array functions but when I draw things using this function, I realize it's storing every single drawn shape in the memory, which is causing spikes in CPU. (Especially when it goes up to a few thousands) How to bake the drawing then remove the array objects on mouserelease? I mean, can Processing behave those objects as a single image after every stroke then I'd clear the array using .remove(0) function? Here's my code: ArrayList <Drawing> drawings = new

Baking the arrays on screen with Processing

╄→гoц情女王★ 提交于 2021-02-08 10:27:25
问题 I like working with Processing array functions but when I draw things using this function, I realize it's storing every single drawn shape in the memory, which is causing spikes in CPU. (Especially when it goes up to a few thousands) How to bake the drawing then remove the array objects on mouserelease? I mean, can Processing behave those objects as a single image after every stroke then I'd clear the array using .remove(0) function? Here's my code: ArrayList <Drawing> drawings = new

Changing brightness depending on sound (Processing)

。_饼干妹妹 提交于 2021-02-08 06:14:47
问题 I am learning processing right now and I am trying to make a sketch that could change colour when the sound changes. (When Amplitude + , Then Brightness+ ) Because changing colour does not need to change as rapid as the draw() function. So how could I build a clock so that the color would not change in every draw? This is the code I am using right now: import ddf.minim.*; import ddf.minim.signals.*; import ddf.minim.analysis.*; import ddf.minim.effects.*; Minim minim; AudioPlayer song; FFT

Changing brightness depending on sound (Processing)

房东的猫 提交于 2021-02-08 06:14:33
问题 I am learning processing right now and I am trying to make a sketch that could change colour when the sound changes. (When Amplitude + , Then Brightness+ ) Because changing colour does not need to change as rapid as the draw() function. So how could I build a clock so that the color would not change in every draw? This is the code I am using right now: import ddf.minim.*; import ddf.minim.signals.*; import ddf.minim.analysis.*; import ddf.minim.effects.*; Minim minim; AudioPlayer song; FFT

How to use the Processing core library with Maven?

早过忘川 提交于 2021-02-07 05:21:11
问题 I want to use Processing libs in my Maven project, but I can't find any artifact for dependency. Where can I get it? 回答1: Edit Since Processing 3, the official artifacts are released to maven central. Use like this (latest version as of February 2019): <dependency> <groupId>org.processing</groupId> <artifactId>core</artifactId> <version>3.3.7</version> </dependency> For old releases You can use the stable processing libraries from clojars.org/quil/processing-core. To use Clojars repository in

Using Processing PGraphics in Python Mode?

試著忘記壹切 提交于 2021-02-05 11:42:35
问题 In Processing's Java Mode, you use PGraphics objects by declaring them globally, setting them up with createGraphics() in setup() and then referring to them in draw(). In the Python mode, what to do is not so clear and doesn't seem to be explained by the documentation. You can't declare variables in Python and variables are not automatically global, i.e. if I just say in setup() c = createGraphics(400,400) and then in draw() say c.beginDraw() I get a NameError: global name 'c' is not defined

How to iterate the same sketch multiple times -(processing)

独自空忆成欢 提交于 2021-01-29 11:47:01
问题 I wrote a program in Processing 3.5.4. It's basic structure is as follows: int SOMEINITIALSTUFF; Class[] classArrays = new Class[]; void setup() { Sets up the simulation to run; size(1200, 700); } void draw() { background(255, 200, 200); Runs Simulation; Collects data; } This runs fine. What I would like to do is run this program multiple times to gather some statistics. I can't figure out how to do this. I want to essentially put this whole code into a loop, and collect the data it creates

Processing | Program is lagging

余生长醉 提交于 2021-01-28 22:06:16
问题 I'm new to Processing and I need to make a program that, captured the main monitor, shows on the second screen the average color and makes a spiral using another color (perceptual dominant color) get by a function. The problem is that the program is so slow (lag, 1FPS). I think it's because it has too many things to do everytime i do a screenshot, but I have no idea how to make it faster. Also there could be many other problems, but the main one is that. Thank you very much! Here's the code:

JavaScript moving an object from starting location to ending location

泪湿孤枕 提交于 2021-01-28 07:37:29
问题 I'm currently taking a course on intro to computer programming. It's an online course and doesn't have much help when you're stuck. I'm using Brackets and p5.js and I'm given a template to start off with. I seem to have done everything needed so far, but I'm not able to animate the spotlight to move. I believe I haven't initialized the spotlight properly but I've tried multiple different ways. If someone could point me in the right direction, I would appreciate it. Code below. Edit the

Processing > Libraries > SVG Export On IntelliJ IDEA

泪湿孤枕 提交于 2021-01-28 07:33:57
问题 I am trying to save svg out of Processing on IntelliJ IDEA. However, when I do this, IntelliJ keeps telling me `The processing.svg.PGraphicsSVG renderer is not in the class path.`` Here is my environment. IntelliJ IDEA 2019.1 (Community Edition) Build #IC-191.6183.87, built on March 27, 2019 JRE: 1.8.0_202-release-1483-b39 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Processing 3.5.3 Windows 10 10.0 What I have tried: Step 1. Run this code in Processing IDE. import processing.svg.*;