# Processing

**URL:** https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=138

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 139

---

## [Displaying an image pixel by pixel](https://discourse.processing.org/t/displaying-an-image-pixel-by-pixel/28839)

<div class="topic-metadata">

**Author:** [@ilalande](https://discourse.processing.org/u/ilalande)\
**Replies:** 3\
**Last updated:** [March 26, 2021, 1:52pm UTC](https://discourse.processing.org/t/displaying-an-image-pixel-by-pixel/28839 "2021-03-26T13:52:01Z")

</div>

Hi, I’m new to processing and working with Daniel Shiffman’s book. I’d like to display an image pixel by pixel, from top left to bottom right. I tried this code but it does what I ask : it draws a diagonal line (I can …

---

## [Measuring Reaction Time When A Box Changes Color](https://discourse.processing.org/t/measuring-reaction-time-when-a-box-changes-color/29298)

<div class="topic-metadata">

**Author:** [@lestacos](https://discourse.processing.org/u/lestacos)\
**Replies:** 0\
**Last updated:** [April 12, 2021, 9:51am UTC](https://discourse.processing.org/t/measuring-reaction-time-when-a-box-changes-color/29298 "2021-04-12T09:51:52Z")

</div>

We are tasked with creating a Processing program which measures reaction time of a person. The program should be able to: The user can start the experiment by pressing the SPACE key. At a random time (between 2 and 6 …

---

## [Virtual Keypad Made and Read in the same sketch](https://discourse.processing.org/t/virtual-keypad-made-and-read-in-the-same-sketch/29290)

<div class="topic-metadata">

**Author:** [@edgee](https://discourse.processing.org/u/edgee)\
**Replies:** 1\
**Last updated:** [April 12, 2021, 1:03am UTC](https://discourse.processing.org/t/virtual-keypad-made-and-read-in-the-same-sketch/29290 "2021-04-12T01:03:44Z")

</div>

Hi, I have a project that will have processing program running on an SBC with a touch panel. on one of the GUI screens, values need to be entered in a field. I created a numpad on the screen using ControlP5. for the la…

---

## [Basic Java global variable question](https://discourse.processing.org/t/basic-java-global-variable-question/29230)

<div class="topic-metadata">

**Author:** [@zggong](https://discourse.processing.org/u/zggong)\
**Replies:** 7\
**Last updated:** [April 11, 2021, 8:31pm UTC](https://discourse.processing.org/t/basic-java-global-variable-question/29230 "2021-04-11T20:31:34Z")

</div>

I’m very new to object oriented programming in general, and I have a question about how to instance/work with global variables which might be caused by a lack of understanding of Java/OOP in general rather than being spe…

---

## [Printing console output](https://discourse.processing.org/t/printing-console-output/29279)

<div class="topic-metadata">

**Author:** [@Th3cG](https://discourse.processing.org/u/Th3cG)\
**Replies:** 5\
**Last updated:** [April 11, 2021, 5:42pm UTC](https://discourse.processing.org/t/printing-console-output/29279 "2021-04-11T17:42:40Z")

</div>

Hello, I’m trying to build a small sketch asking a website some weather data. Unfortunately, the site I’m asking data to throws back a 403 error and Processing seems not able to work. So I tried in this way, editing som…

---

## [Create jar file from sketch in java](https://discourse.processing.org/t/create-jar-file-from-sketch-in-java/29267)

<div class="topic-metadata">

**Author:** [@cocconat](https://discourse.processing.org/u/cocconat)\
**Replies:** 3\
**Last updated:** [April 11, 2021, 3:51pm UTC](https://discourse.processing.org/t/create-jar-file-from-sketch-in-java/29267 "2021-04-11T15:51:30Z")

</div>

Hi, I am trying to pack this into a JAR file with IntelliJ IDEA (I can also change IDE if needed, but I d rather stick to this). The project runs in the IDE if I run the file. Honestly, I don’t really know which is the…

---

## [Linear color lerp with three colors](https://discourse.processing.org/t/linear-color-lerp-with-three-colors/29269)

<div class="topic-metadata">

**Author:** [@jaspervb](https://discourse.processing.org/u/jaspervb)\
**Replies:** 2\
**Last updated:** [April 10, 2021, 10:44pm UTC](https://discourse.processing.org/t/linear-color-lerp-with-three-colors/29269 "2021-04-10T22:44:31Z")

</div>

Hi There, I Want to make a linear color lerp with three colors. I already figured out how to make a lerp with just two colors. Is there someone who can help me to make a ‘lerpColor()’ with three separete color values? T…

---

## [Resize shapes random](https://discourse.processing.org/t/resize-shapes-random/29265)

<div class="topic-metadata">

**Author:** [@Panda](https://discourse.processing.org/u/Panda)\
**Replies:** 1\
**Last updated:** [April 10, 2021, 7:59pm UTC](https://discourse.processing.org/t/resize-shapes-random/29265 "2021-04-10T19:59:19Z")

</div>

Is there a way to randomly resize shapes that are repeating? I have a simple window full of repeating rect(). Is there a way to throw in a random option, so that each repetition is randomly shrunk or enlarged? (Thus, ra…

---

## [Zooming and moving canvas](https://discourse.processing.org/t/zooming-and-moving-canvas/29263)

<div class="topic-metadata">

**Author:** [@rat](https://discourse.processing.org/u/rat)\
**Replies:** 2\
**Last updated:** [April 10, 2021, 5:02pm UTC](https://discourse.processing.org/t/zooming-and-moving-canvas/29263 "2021-04-10T17:02:27Z")

</div>

So I tried implementing a zoom and drag function but its not behaving as expected, I can about the steps to get it to behave like I want it here is a great example of what I was expecting: Desmos | Graphing Calculator …

---

## [Cp5 slider progressbar](https://discourse.processing.org/t/cp5-slider-progressbar/29225)

<div class="topic-metadata">

**Author:** [@HITman](https://discourse.processing.org/u/HITman)\
**Replies:** 2\
**Last updated:** [April 10, 2021, 7:52am UTC](https://discourse.processing.org/t/cp5-slider-progressbar/29225 "2021-04-10T07:52:12Z")

</div>

Hello, how to use slider as progressbar? If I have 10 lines in array and if for 1 line took 1 second, that means that slider should come to 100% in 10 seconds. B.R Tom

---

## [Draw Order Issue - For Loop and ellipses](https://discourse.processing.org/t/draw-order-issue-for-loop-and-ellipses/29258)

<div class="topic-metadata">

**Author:** [@akathewb](https://discourse.processing.org/u/akathewb)\
**Replies:** 2\
**Last updated:** [April 10, 2021, 7:41am UTC](https://discourse.processing.org/t/draw-order-issue-for-loop-and-ellipses/29258 "2021-04-10T07:41:48Z")

</div>

In the code below I’d like the ellipses to draw on top of the code being run in the for loops, but for some reason they keep drawing before, and I’m not sure how to fix it. Thanks for taking a look. //color variables co…

---

## [Reset the game of bursting ballons](https://discourse.processing.org/t/reset-the-game-of-bursting-ballons/29238)

<div class="topic-metadata">

**Author:** [@ashk](https://discourse.processing.org/u/ashk)\
**Replies:** 5\
**Last updated:** [April 10, 2021, 2:26am UTC](https://discourse.processing.org/t/reset-the-game-of-bursting-ballons/29238 "2021-04-10T02:26:38Z")

</div>

How could i reset and restart game with a key or button after gameover is displayed? float x = 0; float y = 0; float dim = 50.0; float xim = 90.0; float start = PI; float stop = TWO\_PI; float angle = 0; float s; …

---

## [How to show the objects when the ball hits left and right side wall](https://discourse.processing.org/t/how-to-show-the-objects-when-the-ball-hits-left-and-right-side-wall/29252)

<div class="topic-metadata">

**Author:** [@pou5678](https://discourse.processing.org/u/pou5678)\
**Replies:** 2\
**Last updated:** [April 9, 2021, 10:14pm UTC](https://discourse.processing.org/t/how-to-show-the-objects-when-the-ball-hits-left-and-right-side-wall/29252 "2021-04-09T22:14:27Z")

</div>

I tried to do to fix this issue, but it didn’t work well… :/… You know this example is bouncing ball and I want to show the obstacle until ball hits obstacle. I want to get some help to solve. :)… (The problem is this c…

---

## [Periodicity of perlin noise](https://discourse.processing.org/t/periodicity-of-perlin-noise/29245)

<div class="topic-metadata">

**Author:** [@Leoperix03](https://discourse.processing.org/u/Leoperix03)\
**Replies:** 3\
**Last updated:** [April 9, 2021, 8:09pm UTC](https://discourse.processing.org/t/periodicity-of-perlin-noise/29245 "2021-04-09T20:09:14Z")

</div>

Hey everyone, I created a grid of nodes (every node is a class) and every node has its own color, the problem is that I tried to randomize each node\_color with noise() function, the problem though is that when I scroll t…

---

## [ControlP5 and keyPressed()](https://discourse.processing.org/t/controlp5-and-keypressed/29221)

<div class="topic-metadata">

**Author:** [@toby](https://discourse.processing.org/u/toby)\
**Replies:** 2\
**Last updated:** [April 9, 2021, 5:44pm UTC](https://discourse.processing.org/t/controlp5-and-keypressed/29221 "2021-04-09T17:44:00Z")

</div>

Hello fellow Processors! I have an issue with CP5 and I’d appreciate any thoughts. I’m using a text field: gui.addTextfield("frames") .setPosition(100, 400) .setSize(30, 30) .setFont(font) .setValue(1)…

---

## [Where or how to learn trigonometry for processing?](https://discourse.processing.org/t/where-or-how-to-learn-trigonometry-for-processing/28819)

<div class="topic-metadata">

**Author:** [@resboy2445](https://discourse.processing.org/u/resboy2445)\
**Replies:** 21\
**Last updated:** [April 9, 2021, 5:05pm UTC](https://discourse.processing.org/t/where-or-how-to-learn-trigonometry-for-processing/28819 "2021-04-09T17:05:10Z")

</div>

Hello all! where can i learn trigonometry for processing? or can somebody teach me? my teacher taught it in class and i still don’t understand it, i even watched a bunch of youtube videos and i still don’t understand the…

---

## [How do i make a new image file](https://discourse.processing.org/t/how-do-i-make-a-new-image-file/29235)

<div class="topic-metadata">

**Author:** [@canslp](https://discourse.processing.org/u/canslp)\
**Replies:** 8\
**Last updated:** [April 9, 2021, 4:39pm UTC](https://discourse.processing.org/t/how-do-i-make-a-new-image-file/29235 "2021-04-09T16:39:07Z")

</div>

i know how to save a PImage as a png but i have to overwrite an existing file. can i manually create a new png file in my data folder and then write a PImage to it? if i just try to do PImage.save(filename) it tells me …

---

## [Pixel window setup](https://discourse.processing.org/t/pixel-window-setup/26136)

<div class="topic-metadata">

**Author:** [@humus](https://discourse.processing.org/u/humus)\
**Replies:** 10\
**Last updated:** [April 9, 2021, 3:17pm UTC](https://discourse.processing.org/t/pixel-window-setup/26136 "2021-04-09T15:17:49Z")

</div>

Hi, I would like to setup a display with CMYK colors chosen randomly every time by Processing (see the exemple in attach but I need one with one colour per pixel and not group of pixels per colour as in the image attach…

---

## [Can random(5) output the number 5?](https://discourse.processing.org/t/can-random-5-output-the-number-5/29241)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 11\
**Last updated:** [April 9, 2021, 1:11pm UTC](https://discourse.processing.org/t/can-random-5-output-the-number-5/29241 "2021-04-09T13:11:31Z")

</div>

Hi! The title says it all. so can floor(random(5)) == 5

---

## [Calculation result doesnt make sense](https://discourse.processing.org/t/calculation-result-doesnt-make-sense/29232)

<div class="topic-metadata">

**Author:** [@Rektic](https://discourse.processing.org/u/Rektic)\
**Replies:** 3\
**Last updated:** [April 9, 2021, 8:42am UTC](https://discourse.processing.org/t/calculation-result-doesnt-make-sense/29232 "2021-04-09T08:42:57Z")

</div>

Hi, I need help. Its simple, 3\*1/4 obviously equals 0.75 but when I write the following code, it says, the result is 0.0 float x = 3\*1/4; void draw(){ println(x); }

---

## [How do I find a maximum number of consecutive non-zero values in the array?](https://discourse.processing.org/t/how-do-i-find-a-maximum-number-of-consecutive-non-zero-values-in-the-array/29200)

<div class="topic-metadata">

**Author:** [@batmm](https://discourse.processing.org/u/batmm)\
**Replies:** 20\
**Last updated:** [April 9, 2021, 1:00am UTC](https://discourse.processing.org/t/how-do-i-find-a-maximum-number-of-consecutive-non-zero-values-in-the-array/29200 "2021-04-09T01:00:10Z")

</div>

please format code with \</\> button \* homework policy \* asking questions I am going to write a function that accept an array of integers(the frequency of number). In this function, I need to return a maximum number of…

---

## [Arduino write data - serial](https://discourse.processing.org/t/arduino-write-data-serial/29128)

<div class="topic-metadata">

**Author:** [@HITman](https://discourse.processing.org/u/HITman)\
**Replies:** 10\
**Last updated:** [April 8, 2021, 11:56pm UTC](https://discourse.processing.org/t/arduino-write-data-serial/29128 "2021-04-08T23:56:08Z")

</div>

Hello, Can someone help me with processing serial code. I have a txt file with gcode, what I need is to open that file, ( for example positions.txt ) read line by line ( array ) and using timer ( delay ) send line b…

---

## [Shapes 4x4 screen location](https://discourse.processing.org/t/shapes-4x4-screen-location/29186)

<div class="topic-metadata">

**Author:** [@Waller](https://discourse.processing.org/u/Waller)\
**Replies:** 6\
**Last updated:** [April 8, 2021, 5:55pm UTC](https://discourse.processing.org/t/shapes-4x4-screen-location/29186 "2021-04-08T17:55:40Z")

</div>

Hey there, everyone! I’m pretty new to Processing and I’m having a hard time locating shapes on the screen. TASK Create 16 shapes, laying 4x4 on screen, filled with random colors and value of vertex of each next shape…

---

## [Horizontal wall clipping](https://discourse.processing.org/t/horizontal-wall-clipping/29226)

<div class="topic-metadata">

**Author:** [@davejr17](https://discourse.processing.org/u/davejr17)\
**Replies:** 0\
**Last updated:** [April 8, 2021, 3:58pm UTC](https://discourse.processing.org/t/horizontal-wall-clipping/29226 "2021-04-08T15:58:01Z")

</div>

I was wondering how you would go about coding this horizontal wall clipping this is from https://fabiensanglard.net/gebbdoom.pdf on page 212. having it so it only draws on the screen where it hasn’t already been dra…

---

## [Having two different thick lines in one sketch](https://discourse.processing.org/t/having-two-different-thick-lines-in-one-sketch/29216)

<div class="topic-metadata">

**Author:** [@Estefania](https://discourse.processing.org/u/Estefania)\
**Replies:** 1\
**Last updated:** [April 8, 2021, 1:31pm UTC](https://discourse.processing.org/t/having-two-different-thick-lines-in-one-sketch/29216 "2021-04-08T13:31:01Z")

</div>

I have a question concerning drawing different thick lines in my sketch. If I want to draw two lines and each of them should use a different stroke weight - how would I do this in Processing? My code: import processing…

---

## [Use Sensors to Play a Video Using Gestures on MacOS and Win](https://discourse.processing.org/t/use-sensors-to-play-a-video-using-gestures-on-macos-and-win/29207)

<div class="topic-metadata">

**Author:** [@JackyMao](https://discourse.processing.org/u/JackyMao)\
**Replies:** 8\
**Last updated:** [April 8, 2021, 1:04pm UTC](https://discourse.processing.org/t/use-sensors-to-play-a-video-using-gestures-on-macos-and-win/29207 "2021-04-08T13:04:57Z")

</div>

We are a few beginners in a school, we want to use Kinect to tell the computer to play a video or a bit of animation based on the movements of the person in front. We used OpenKinect Library on MacOS to try to do this, w…

---

## [Problems in interaction between Arduino and Processing](https://discourse.processing.org/t/problems-in-interaction-between-arduino-and-processing/29195)

<div class="topic-metadata">

**Author:** [@Yoollow](https://discourse.processing.org/u/Yoollow)\
**Replies:** 3\
**Last updated:** [April 8, 2021, 7:18am UTC](https://discourse.processing.org/t/problems-in-interaction-between-arduino-and-processing/29195 "2021-04-08T07:18:01Z")

</div>

Hello, I’m having problems in the following exercise: I have created a grid of 9 cells on Processing, i cyclically color in yellow the diagonal ones. From my Arduino code i want to send the information about which of …

---

## [How to change the pitch of the audioplayer output file in minim?](https://discourse.processing.org/t/how-to-change-the-pitch-of-the-audioplayer-output-file-in-minim/29197)

<div class="topic-metadata">

**Author:** [@yeppii](https://discourse.processing.org/u/yeppii)\
**Replies:** 1\
**Last updated:** [April 7, 2021, 7:15pm UTC](https://discourse.processing.org/t/how-to-change-the-pitch-of-the-audioplayer-output-file-in-minim/29197 "2021-04-07T19:15:31Z")

</div>

I’m making a piano-like app, and I have a sound file. I want it to play at different pitches every time I press a key. I cant figure out how to change the pitch. How can I do this?

---

## [Select all boolean variables in one keyword](https://discourse.processing.org/t/select-all-boolean-variables-in-one-keyword/28908)

<div class="topic-metadata">

**Author:** [@freddukas](https://discourse.processing.org/u/freddukas)\
**Replies:** 3\
**Last updated:** [April 7, 2021, 6:49pm UTC](https://discourse.processing.org/t/select-all-boolean-variables-in-one-keyword/28908 "2021-04-07T18:49:53Z")

</div>

hello everyone. is there a trick or a solution to interact with all boolean variables in one keyword ? I hope something like " all.boolean == true" . I think I already saw something like this but I can’t remember exac…

---

## [Random boolean values](https://discourse.processing.org/t/random-boolean-values/29191)

<div class="topic-metadata">

**Author:** [@freddukas](https://discourse.processing.org/u/freddukas)\
**Replies:** 4\
**Last updated:** [April 7, 2021, 5:50pm UTC](https://discourse.processing.org/t/random-boolean-values/29191 "2021-04-07T17:50:12Z")

</div>

Hello, everyone. I need some random boolean variables to be changed in my draw fonction Do i have a way to code a boolean variable randomly change ? Thanks a lot

[Previous page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=137)

[Next page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=139)
