# Processing

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

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

**Page:** 280

---

## [Issue with scale() function](https://discourse.processing.org/t/issue-with-scale-function/6140)

<div class="topic-metadata">

**Author:** [@noeblassel](https://discourse.processing.org/u/noeblassel)\
**Replies:** 6\
**Last updated:** [August 10, 2019, 3:33pm UTC](https://discourse.processing.org/t/issue-with-scale-function/6140 "2019-08-10T15:33:16Z")

</div>

Hi! I’ve been working on a processing script using OpenCV to automatically align, scale and rotate a given set of pictures of frontal faces so that the eyes always appear in a fixed specified position in the result. It w…

---

## [How to calculate the center of a circle inscribed in a circle sector](https://discourse.processing.org/t/how-to-calculate-the-center-of-a-circle-inscribed-in-a-circle-sector/13279)

<div class="topic-metadata">

**Author:** [@ddownn](https://discourse.processing.org/u/ddownn)\
**Replies:** 3\
**Last updated:** [August 10, 2019, 9:16am UTC](https://discourse.processing.org/t/how-to-calculate-the-center-of-a-circle-inscribed-in-a-circle-sector/13279 "2019-08-10T09:16:06Z")

</div>

I’m having trouble figuring out how to set “r” so that the small circle is inscribed within the sector. The number of sectors will vary. I would also appreciate help with math to calculate the points where the small circ…

---

## [Serial Event null pointer exception](https://discourse.processing.org/t/serial-event-null-pointer-exception/13275)

<div class="topic-metadata">

**Author:** [@l-arc-en-ciel](https://discourse.processing.org/u/l-arc-en-ciel)\
**Replies:** 3\
**Last updated:** [August 9, 2019, 11:54pm UTC](https://discourse.processing.org/t/serial-event-null-pointer-exception/13275 "2019-08-09T23:54:34Z")

</div>

I get this error code every few times: COM4 test {"lat{"lat":67.74801,"lng":21.2934} java.lang.RuntimeException: Expected a ':' after a key at processing.data.JSONObject.\<init\>(JSONObject.java:264) at processing.data…

---

## [Creating a grid with a PShape](https://discourse.processing.org/t/creating-a-grid-with-a-pshape/13268)

<div class="topic-metadata">

**Author:** [@thedurf18](https://discourse.processing.org/u/thedurf18)\
**Replies:** 12\
**Last updated:** [August 9, 2019, 5:41pm UTC](https://discourse.processing.org/t/creating-a-grid-with-a-pshape/13268 "2019-08-09T17:41:52Z")

</div>

How could I turn this code into a grid? I’d appreciate any help. int many = 10; PShape\[\] a = new PShape\[many\]; void setup() { size(1680, 1005, P3D); make\_shapes(); } void make\_shapes() { for (int i = 0; i \< many…

---

## [Camera() doesn't expect parameters](https://discourse.processing.org/t/camera-doesnt-expect-parameters/13139)

<div class="topic-metadata">

**Author:** [@l-arc-en-ciel](https://discourse.processing.org/u/l-arc-en-ciel)\
**Replies:** 7\
**Last updated:** [August 9, 2019, 5:35pm UTC](https://discourse.processing.org/t/camera-doesnt-expect-parameters/13139 "2019-08-09T17:35:23Z")

</div>

I want to use centerX and centerY in my 2d scene so that the camera centers on a moving rectangle (you wouldn’t see the rectangle move then, but it leaves a trail, so you see the trail and the view centers around the hea…

---

## [G4P GUI button function](https://discourse.processing.org/t/g4p-gui-button-function/12113)

<div class="topic-metadata">

**Author:** [@savan](https://discourse.processing.org/u/savan)\
**Replies:** 2\
**Last updated:** [August 9, 2019, 6:43am UTC](https://discourse.processing.org/t/g4p-gui-button-function/12113 "2019-08-09T06:43:38Z")

</div>

Hello everyone, I am trying to make a software for logging data from an Arduino to a CSV file through serial communication. I used the G4P GUI builder to create a basic GUI, and have made two buttons to start and stop …

---

## [Accessing pixel values just above a line](https://discourse.processing.org/t/accessing-pixel-values-just-above-a-line/13145)

<div class="topic-metadata">

**Author:** [@eric](https://discourse.processing.org/u/eric)\
**Replies:** 7\
**Last updated:** [August 8, 2019, 9:25pm UTC](https://discourse.processing.org/t/accessing-pixel-values-just-above-a-line/13145 "2019-08-08T21:25:12Z")

</div>

I’m trying to see if the pixel is black or white, and then move on to the next pixel down the line. I’ve gotten flat lines down, I just keep track of the endpoints of the line, and add 2 to not count the line’s color. …

---

## [Call a procedure by its name in String](https://discourse.processing.org/t/call-a-procedure-by-its-name-in-string/13249)

<div class="topic-metadata">

**Author:** [@LuckSmith](https://discourse.processing.org/u/LuckSmith)\
**Replies:** 8\
**Last updated:** [August 8, 2019, 6:24pm UTC](https://discourse.processing.org/t/call-a-procedure-by-its-name-in-string/13249 "2019-08-08T18:24:27Z")

</div>

Ok, so you can do like thread("myProcedure"); but it creates a new thread. Is it possible to call a procedure in a similar way it the main thread? Or even maybe there is a way to execute code in a String? Like Strin…

---

## [Kinect SimpleOpenNI Delay on lost user](https://discourse.processing.org/t/kinect-simpleopenni-delay-on-lost-user/13166)

<div class="topic-metadata">

**Author:** [@QueenBee](https://discourse.processing.org/u/QueenBee)\
**Replies:** 1\
**Last updated:** [August 8, 2019, 6:03pm UTC](https://discourse.processing.org/t/kinect-simpleopenni-delay-on-lost-user/13166 "2019-08-08T18:03:11Z")

</div>

I’m trying to make a program which counts the number of users the Kinect sees, and displays a particular image depending on that number. if (userCount == 0){ println("No Users!"); } else if (userCount == 1){ …

---

## [P3D background refresh issue](https://discourse.processing.org/t/p3d-background-refresh-issue/13237)

<div class="topic-metadata">

**Author:** [@mszivos](https://discourse.processing.org/u/mszivos)\
**Replies:** 4\
**Last updated:** [August 8, 2019, 2:52pm UTC](https://discourse.processing.org/t/p3d-background-refresh-issue/13237 "2019-08-08T14:52:33Z")

</div>

Not sure what the issue is but the background in P3D does not seem to be refreshing. The screen is not cleared between frames. This has happened recently and happens on old sketches or just simple 3D examples. Running Wi…

---

## [Organizing large number of tabs](https://discourse.processing.org/t/organizing-large-number-of-tabs/13241)

<div class="topic-metadata">

**Author:** [@adamsero](https://discourse.processing.org/u/adamsero)\
**Replies:** 4\
**Last updated:** [August 8, 2019, 11:03am UTC](https://discourse.processing.org/t/organizing-large-number-of-tabs/13241 "2019-08-08T11:03:54Z")

</div>

Hello, I am currently working on a big game in Processing. I am aware that it might not be the best framework to choose from, but I have already made a decision and now I have a problem with organizing all my .pde files…

---

## [How do I get my sketch to perform faster?](https://discourse.processing.org/t/how-do-i-get-my-sketch-to-perform-faster/13146)

<div class="topic-metadata">

**Author:** [@thedurf18](https://discourse.processing.org/u/thedurf18)\
**Replies:** 4\
**Last updated:** [August 8, 2019, 12:57am UTC](https://discourse.processing.org/t/how-do-i-get-my-sketch-to-perform-faster/13146 "2019-08-08T00:57:33Z")

</div>

I have written a sketch that is almost 6000 lines, and I’m still not done. I wanted to check my progress so far to see how the animation is running, and it is very laggy. I tried increasing frame rate to 30 and 60, and i…

---

## [Passing arrays as arguments](https://discourse.processing.org/t/passing-arrays-as-arguments/6692)

<div class="topic-metadata">

**Author:** [@poppanona](https://discourse.processing.org/u/poppanona)\
**Replies:** 4\
**Last updated:** [August 7, 2019, 11:02pm UTC](https://discourse.processing.org/t/passing-arrays-as-arguments/6692 "2019-08-07T23:02:54Z")

</div>

How are arrays passed as arguments into objects? Do i need to create a new array in the object to accept the array data?

---

## [Issue when loading SVG file: Distortion with P2D or P3D renderer](https://discourse.processing.org/t/issue-when-loading-svg-file-distortion-with-p2d-or-p3d-renderer/13190)

<div class="topic-metadata">

**Author:** [@uli-b](https://discourse.processing.org/u/uli-b)\
**Replies:** 3\
**Last updated:** [August 7, 2019, 8:37pm UTC](https://discourse.processing.org/t/issue-when-loading-svg-file-distortion-with-p2d-or-p3d-renderer/13190 "2019-08-07T20:37:12Z")

</div>

Hello, I am using the processing java library as part of my project. Within the project, I like to load svg files and draw them on a pgraphics object. The svg files show icons with some white space around them. This wor…

---

## [How to center the alignment always](https://discourse.processing.org/t/how-to-center-the-alignment-always/13223)

<div class="topic-metadata">

**Author:** [@Hemanth](https://discourse.processing.org/u/Hemanth)\
**Replies:** 3\
**Last updated:** [August 7, 2019, 6:31pm UTC](https://discourse.processing.org/t/how-to-center-the-alignment-always/13223 "2019-08-07T18:31:28Z")

</div>

Hi, I was learning processing and I was trying something with the co ordinates, and I am having trouble in aligning to the center of the display window, for reference I have attached the video. In detailed explanation o…

---

## [keyPressed() events get missed when another key is held](https://discourse.processing.org/t/keypressed-events-get-missed-when-another-key-is-held/12696)

<div class="topic-metadata">

**Author:** [@Architector\_4](https://discourse.processing.org/u/Architector_4)\
**Replies:** 19\
**Last updated:** [August 7, 2019, 4:09pm UTC](https://discourse.processing.org/t/keypressed-events-get-missed-when-another-key-is-held/12696 "2019-08-07T16:09:32Z")

</div>

EDIT: This seems to be related to key repeating that OS does when user holds a key for long enough, and how P2D/P3D engines handle that key repeating. My conclusion is seen here: keyPressed() events get missed when anoth…

---

## [Match depth image with color image](https://discourse.processing.org/t/match-depth-image-with-color-image/13161)

<div class="topic-metadata">

**Author:** [@Cai](https://discourse.processing.org/u/Cai)\
**Replies:** 1\
**Last updated:** [August 7, 2019, 1:45pm UTC](https://discourse.processing.org/t/match-depth-image-with-color-image/13161 "2019-08-07T13:45:33Z")

</div>

how do I minimize the error such that the color and displayed pixel match?

---

## [Converting my Processing sketch to a Processing.js sketch](https://discourse.processing.org/t/converting-my-processing-sketch-to-a-processing-js-sketch/13227)

<div class="topic-metadata">

**Author:** [@graysonh](https://discourse.processing.org/u/graysonh)\
**Replies:** 2\
**Last updated:** [August 7, 2019, 1:17pm UTC](https://discourse.processing.org/t/converting-my-processing-sketch-to-a-processing-js-sketch/13227 "2019-08-07T13:17:11Z")

</div>

Hi All, I have recently created an interactive version of a Daily Minimal graphic design and I really like the way it performs in Processing. I have been trying to put the sketch on OpenProcessing by using processing.js…

---

## [P3D skybox texture mapping problem](https://discourse.processing.org/t/p3d-skybox-texture-mapping-problem/13212)

<div class="topic-metadata">

**Author:** [@quark](https://discourse.processing.org/u/quark)\
**Replies:** 4\
**Last updated:** [August 7, 2019, 9:26am UTC](https://discourse.processing.org/t/p3d-skybox-texture-mapping-problem/13212 "2019-08-07T09:26:53Z")

</div>

The picture below shows a simple 3D scene with terrain and a skybox. The problem is that although the sky images tile seamlessly in 2D when applied to my skybox you can see the box seams. Although it is possible I am do…

---

## [How shall I scale my Kinect interaction full screen?](https://discourse.processing.org/t/how-shall-i-scale-my-kinect-interaction-full-screen/13059)

<div class="topic-metadata">

**Author:** [@AxeFire](https://discourse.processing.org/u/AxeFire)\
**Replies:** 2\
**Last updated:** [August 7, 2019, 8:15am UTC](https://discourse.processing.org/t/how-shall-i-scale-my-kinect-interaction-full-screen/13059 "2019-08-07T08:15:40Z")

</div>

Hello, I have created an interactive “graphic” with Open Kinect and Processing where the Kinect detects your hand movements to reveal the “moon surface image” which is below the top image called “moon dirt”. Basically y…

---

## [Indexing a for loop](https://discourse.processing.org/t/indexing-a-for-loop/13231)

<div class="topic-metadata">

**Author:** [@thedurf18](https://discourse.processing.org/u/thedurf18)\
**Replies:** 8\
**Last updated:** [August 7, 2019, 5:33am UTC](https://discourse.processing.org/t/indexing-a-for-loop/13231 "2019-08-07T05:33:12Z")

</div>

How can I have access to individual shapes that are contained within a for loop? Can I index the for loop and access the individual shapes through an array? I just received help with this code: PShape a; void setup() …

---

## [Using PShape in a for loop](https://discourse.processing.org/t/using-pshape-in-a-for-loop/13230)

<div class="topic-metadata">

**Author:** [@thedurf18](https://discourse.processing.org/u/thedurf18)\
**Replies:** 4\
**Last updated:** [August 7, 2019, 4:20am UTC](https://discourse.processing.org/t/using-pshape-in-a-for-loop/13230 "2019-08-07T04:20:39Z")

</div>

I’m trying to use the PShape I created and make multiple ones within a for loop, but I’m having some trouble. I’d appreciate any help. float variable; PShape a; void setup(){ size(1680,1005,P3D); background(0); } …

---

## [Load 16 bit per pixel PNG image](https://discourse.processing.org/t/load-16-bit-per-pixel-png-image/13221)

<div class="topic-metadata">

**Author:** [@Nikolai](https://discourse.processing.org/u/Nikolai)\
**Replies:** 1\
**Last updated:** [August 6, 2019, 11:57pm UTC](https://discourse.processing.org/t/load-16-bit-per-pixel-png-image/13221 "2019-08-06T23:57:48Z")

</div>

I need to load a 16 bit per pixel PNG image and save it as 8 bit (with some processing done on the channels). How can I do this in processing. Any image that I load only has 8 bit depth (even if I crank up the colorMode …

---

## [Making a trading card game](https://discourse.processing.org/t/making-a-trading-card-game/13219)

<div class="topic-metadata">

**Author:** [@ctrembla](https://discourse.processing.org/u/ctrembla)\
**Replies:** 0\
**Last updated:** [August 6, 2019, 9:37pm UTC](https://discourse.processing.org/t/making-a-trading-card-game/13219 "2019-08-06T21:37:02Z")

</div>

I’m trying to make a trading card game, but it keeps messing up. I got a table with an enemy to see if works then I created 2 creatures, one player, one enemy, so far they can walk towards each other & stop when they rea…

---

## [Saving to PDF while using the copy() function](https://discourse.processing.org/t/saving-to-pdf-while-using-the-copy-function/13201)

<div class="topic-metadata">

**Author:** [@daniel\_betts](https://discourse.processing.org/u/daniel_betts)\
**Replies:** 3\
**Last updated:** [August 6, 2019, 7:54pm UTC](https://discourse.processing.org/t/saving-to-pdf-while-using-the-copy-function/13201 "2019-08-06T19:54:39Z")

</div>

Hey, I’m have written a small code for a sort of text-warping tool using PGraphics, PFont, and the copy() function. I would like to output “Many Frames Into One File (With Screen Display)” as explained in the PDF librar…

---

## [Looping through an array?](https://discourse.processing.org/t/looping-through-an-array/13078)

<div class="topic-metadata">

**Author:** [@Pbchocochipcheerios](https://discourse.processing.org/u/Pbchocochipcheerios)\
**Replies:** 19\
**Last updated:** [August 6, 2019, 7:52pm UTC](https://discourse.processing.org/t/looping-through-an-array/13078 "2019-08-06T19:52:58Z")

</div>

If I have an array with 14 elements, Is there a way to loop through the array so that when I get to array\[13\], it automatically goes back to array\[0\] up to array \[13\] and loop back to array\[0\] etc etc? I was thinking mo…

---

## [Unicode and Smart quotes not being drawn properly](https://discourse.processing.org/t/unicode-and-smart-quotes-not-being-drawn-properly/13213)

<div class="topic-metadata">

**Author:** [@n055](https://discourse.processing.org/u/n055)\
**Replies:** 4\
**Last updated:** [August 6, 2019, 6:14pm UTC](https://discourse.processing.org/t/unicode-and-smart-quotes-not-being-drawn-properly/13213 "2019-08-06T18:14:27Z")

</div>

I am trying to display text entries by drawing them in my sketch. All of the text I will be using has quotation marks, and the source I am getting them from has them formatted as “curly” or “smart” quotes. However, when…

---

## [Guidance on using LiquidFunProcessing library](https://discourse.processing.org/t/guidance-on-using-liquidfunprocessing-library/13129)

<div class="topic-metadata">

**Author:** [@julianpb](https://discourse.processing.org/u/julianpb)\
**Replies:** 4\
**Last updated:** [August 6, 2019, 2:30pm UTC](https://discourse.processing.org/t/guidance-on-using-liquidfunprocessing-library/13129 "2019-08-06T14:30:22Z")

</div>

Hi, I’m creating a simple display in Processing for my research project that requires a 2D fluid simulation, so I’ve been trying to use LiquidFunProcessing. I’ve managed to create the basic concept, but I need to do some…

---

## [VHS/lo-fi Glitch Effect](https://discourse.processing.org/t/vhs-lo-fi-glitch-effect/12746)

<div class="topic-metadata">

**Author:** [@Armin](https://discourse.processing.org/u/Armin)\
**Replies:** 10\
**Last updated:** [August 6, 2019, 1:41pm UTC](https://discourse.processing.org/t/vhs-lo-fi-glitch-effect/12746 "2019-08-06T13:41:37Z")

</div>

Hi How can I get a VHS/lo-fi image effect like this? I’ve googled to find the algorithm and codes to get this effect but i didn’t find anything!

---

## [Typing on the canvas](https://discourse.processing.org/t/typing-on-the-canvas/12990)

<div class="topic-metadata">

**Author:** [@Codex](https://discourse.processing.org/u/Codex)\
**Replies:** 8\
**Last updated:** [August 6, 2019, 1:36pm UTC](https://discourse.processing.org/t/typing-on-the-canvas/12990 "2019-08-06T13:36:02Z")

</div>

I’m new to processing and I need assistance with something. I need an example with explanation on how to type in a set of boxes created with loop by clicking on each cell.

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

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