# Latest

**URL:** https://discourse.processing.org/latest.md?no_subcategories=false&page=167

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

**Page:** 168

---

## [DSLR Webcam on Raspberry Pi](https://discourse.processing.org/t/dslr-webcam-on-raspberry-pi/34336)

<div class="topic-metadata">

**Author:** [@harrybadger](https://discourse.processing.org/u/harrybadger)\
**Replies:** 0\
**Last updated:** [December 28, 2021, 11:16am UTC](https://discourse.processing.org/t/dslr-webcam-on-raspberry-pi/34336 "2021-12-28T11:16:09Z")

</div>

Hi, I want to use live webcam images in a Processing sketch. I have tried the example code from: https://processing.org/reference/libraries/video/Capture.html Processing isn’t able to detect my webcam. I am running P…

---

## [Graphics quality compared to OpenFrameworks](https://discourse.processing.org/t/graphics-quality-compared-to-openframeworks/34308)

<div class="topic-metadata">

**Author:** [@woodwindblues](https://discourse.processing.org/u/woodwindblues)\
**Replies:** 11\
**Last updated:** [December 28, 2021, 9:10am UTC](https://discourse.processing.org/t/graphics-quality-compared-to-openframeworks/34308 "2021-12-28T09:10:28Z")

</div>

I am working on a sketch that is basically a very simple particle system, but the trails are drawn as lines. I wrote one version of the code in processing and one in openFrameworks. The code is nearly identical, but the …

---

## [Unable to apply shader to PGraphics in p5js](https://discourse.processing.org/t/unable-to-apply-shader-to-pgraphics-in-p5js/34322)

<div class="topic-metadata">

**Author:** [@urotas](https://discourse.processing.org/u/urotas)\
**Replies:** 4\
**Last updated:** [December 28, 2021, 3:03am UTC](https://discourse.processing.org/t/unable-to-apply-shader-to-pgraphics-in-p5js/34322 "2021-12-28T03:03:30Z")

</div>

Hi. I’m trying to apply a shader to PGraphics. I was able to apply a shader to a canvas. But, when I tried to apply a shader to PGraphics as well, I could not. Should I add something? This is what I’m applying to the c…

---

## [Libraries related - mappa Map style change does not work](https://discourse.processing.org/t/libraries-related-mappa-map-style-change-does-not-work/34326)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 0\
**Last updated:** [December 28, 2021, 1:06am UTC](https://discourse.processing.org/t/libraries-related-mappa-map-style-change-does-not-work/34326 "2021-12-28T01:06:36Z")

</div>

Reference site 1: Reference site 2: MapboxGL Example Reference site 3: Map style change does not work. Previous source code const options = { lat: 0, ng: 0, zoom: 4, style: 'mapbox://styles/mapbox…

---

## [Stroke doesn't look correct when using P3D in the 3rd argument of size()](https://discourse.processing.org/t/stroke-doesnt-look-correct-when-using-p3d-in-the-3rd-argument-of-size/34324)

<div class="topic-metadata">

**Author:** [@Dwight](https://discourse.processing.org/u/Dwight)\
**Replies:** 0\
**Last updated:** [December 27, 2021, 9:53pm UTC](https://discourse.processing.org/t/stroke-doesnt-look-correct-when-using-p3d-in-the-3rd-argument-of-size/34324 "2021-12-27T21:53:45Z")

</div>

When I make a rectangle with a strokeWeight of 20, and when I don’t use P3D in the 3rd argument of the size() function, it looks like this: But when I use P3D, the stroke is beveled a little bit: How do I remove …

---

## [3D Lidar point cloud to Blender](https://discourse.processing.org/t/3d-lidar-point-cloud-to-blender/34198)

<div class="topic-metadata">

**Author:** [@StainlessHolz](https://discourse.processing.org/u/StainlessHolz)\
**Replies:** 7\
**Last updated:** [December 27, 2021, 9:50pm UTC](https://discourse.processing.org/t/3d-lidar-point-cloud-to-blender/34198 "2021-12-27T21:50:03Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hi Everyone, I want to scan in 3D and mill these with CAM. I have access to some nice tools to do so: Livox Mid-40 LiDAR Fusion 360 and its …

---

## [Simple way to encode and decode a string according to a password?](https://discourse.processing.org/t/simple-way-to-encode-and-decode-a-string-according-to-a-password/34298)

<div class="topic-metadata">

**Author:** [@mungle](https://discourse.processing.org/u/mungle)\
**Replies:** 1\
**Last updated:** [December 27, 2021, 7:34pm UTC](https://discourse.processing.org/t/simple-way-to-encode-and-decode-a-string-according-to-a-password/34298 "2021-12-27T19:34:07Z")

</div>

Hello everyone, Does Processing have built-in functions, libraries or a simple way of encoding/decoding strings using a password? Something like this: encode('My String', password = 'mypass') //'ajdnfladfa739adl23' d…

---

## [How to feed curve() an array of points](https://discourse.processing.org/t/how-to-feed-curve-an-array-of-points/34310)

<div class="topic-metadata">

**Author:** [@nsegal](https://discourse.processing.org/u/nsegal)\
**Replies:** 4\
**Last updated:** [December 27, 2021, 9:49am UTC](https://discourse.processing.org/t/how-to-feed-curve-an-array-of-points/34310 "2021-12-27T09:49:52Z")

</div>

I made a DataPoint object that has an x property and a y property. I generated an array of these and now want to draw a curve that takes the array as its argument. I tried something like the following: let s = "" for …

---

## [Processing X P5JS (image quality on canvas)](https://discourse.processing.org/t/processing-x-p5js-image-quality-on-canvas/34272)

<div class="topic-metadata">

**Author:** [@vargas](https://discourse.processing.org/u/vargas)\
**Replies:** 7\
**Last updated:** [December 26, 2021, 11:44pm UTC](https://discourse.processing.org/t/processing-x-p5js-image-quality-on-canvas/34272 "2021-12-26T23:44:06Z")

</div>

I have transferred a processing code to P5JS. In it I use an image with rotation and all axes. But image quality on P5JS canvas is not the same as on processing. Does anybody know how to solve this?

---

## [How to fill indivdual shapes with different colours in a for loop](https://discourse.processing.org/t/how-to-fill-indivdual-shapes-with-different-colours-in-a-for-loop/34271)

<div class="topic-metadata">

**Author:** [@UltimateDoug9](https://discourse.processing.org/u/UltimateDoug9)\
**Replies:** 4\
**Last updated:** [December 26, 2021, 11:12pm UTC](https://discourse.processing.org/t/how-to-fill-indivdual-shapes-with-different-colours-in-a-for-loop/34271 "2021-12-26T23:12:28Z")

</div>

I’m making a drawing program and I want a sidebar that shows the colour options. How would I make each rectangle a different colour if there in a for loop? for (int j = 1; j\<= 3; j++) { for (int i = 1; i\<= 2; i++) { …

---

## [What is wrong with this simple code](https://discourse.processing.org/t/what-is-wrong-with-this-simple-code/34289)

<div class="topic-metadata">

**Author:** [@parichko](https://discourse.processing.org/u/parichko)\
**Replies:** 4\
**Last updated:** [December 26, 2021, 5:55pm UTC](https://discourse.processing.org/t/what-is-wrong-with-this-simple-code/34289 "2021-12-26T17:55:37Z")

</div>

When the ball goes to the down right corner it freezes. I tried everything. What is wrong with that code. let x = 50 let y = 50 let s1 = 1 let s2 = 1 function setup() { createCanvas(400, 400); } function draw() { b…

---

## [Simulate Mouse movement with Robot](https://discourse.processing.org/t/simulate-mouse-movement-with-robot/34301)

<div class="topic-metadata">

**Author:** [@pml](https://discourse.processing.org/u/pml)\
**Replies:** 0\
**Last updated:** [December 26, 2021, 4:53pm UTC](https://discourse.processing.org/t/simulate-mouse-movement-with-robot/34301 "2021-12-26T16:53:38Z")

</div>

Hello ! I’m attempting to simulate the movement of my mouse with Robot but it does not work : my mouse just jump between the points but the particles don’t follow it. Can you explain me what is wrong with my code ? im…

---

## [A more accurate approach to calculating text width & text height](https://discourse.processing.org/t/a-more-accurate-approach-to-calculating-text-width-text-height/24879)

<div class="topic-metadata">

**Author:** [@micycle](https://discourse.processing.org/u/micycle)\
**Replies:** 5\
**Last updated:** [December 26, 2021, 2:49pm UTC](https://discourse.processing.org/t/a-more-accurate-approach-to-calculating-text-width-text-height/24879 "2021-12-26T14:49:57Z")

</div>

Originally posted on SO, but should be relevant here too. Using the inbuilt functions textWidth(), textAscent(), and textDescent() are an easy way to get a good approximate result for the height and width of a strin…

---

## [How to properly export this simple 3D sketch to PDF?](https://discourse.processing.org/t/how-to-properly-export-this-simple-3d-sketch-to-pdf/34290)

<div class="topic-metadata">

**Author:** [@sorenkirk](https://discourse.processing.org/u/sorenkirk)\
**Replies:** 1\
**Last updated:** [December 26, 2021, 9:16am UTC](https://discourse.processing.org/t/how-to-properly-export-this-simple-3d-sketch-to-pdf/34290 "2021-12-26T09:16:53Z")

</div>

I have a somewhat simple sketch but whenever I export to pdf it looks really bad. What is the best way to get a vector file for this sketch that will look like how it does when run in Processing? import processing.pdf.\*…

---

## [I am trying to express in real time by passing sound data](https://discourse.processing.org/t/i-am-trying-to-express-in-real-time-by-passing-sound-data/34291)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 0\
**Last updated:** [December 26, 2021, 12:30am UTC](https://discourse.processing.org/t/i-am-trying-to-express-in-real-time-by-passing-sound-data/34291 "2021-12-26T00:30:50Z")

</div>

I am trying to express in real time by passing sound data. Mode : JAVA Mode Library : minim //================================================================// import ddf.minim.\*; Minim minim; AudioInput in; Aud…

---

## [Checking Boolean variable breaks serial communication code with Arduino](https://discourse.processing.org/t/checking-boolean-variable-breaks-serial-communication-code-with-arduino/34149)

<div class="topic-metadata">

**Author:** [@grudovz](https://discourse.processing.org/u/grudovz)\
**Replies:** 3\
**Last updated:** [December 25, 2021, 3:45pm UTC](https://discourse.processing.org/t/checking-boolean-variable-breaks-serial-communication-code-with-arduino/34149 "2021-12-25T15:45:05Z")

</div>

I’m learning how to use processing to communicate via serial with arduino. Using the basic code below works, both variables are getting written to the arduino. And they then get printed to the processing console. (serial…

---

## [Drawing a board using GUI](https://discourse.processing.org/t/drawing-a-board-using-gui/34276)

<div class="topic-metadata">

**Author:** [@f.y](https://discourse.processing.org/u/f.y)\
**Replies:** 2\
**Last updated:** [December 25, 2021, 1:42pm UTC](https://discourse.processing.org/t/drawing-a-board-using-gui/34276 "2021-12-25T13:42:05Z")

</div>

Hello, below is a code I wrote to draw a board using GUI. I want to locate the board in the center of my screen but I don\`t know-how. Can someone help, please? And, can you tell me how can I get access to each of the ce…

---

## [What is the best way to make a if statement that activates when a shape hits the outer part of another shape or as some people may call it the outline](https://discourse.processing.org/t/what-is-the-best-way-to-make-a-if-statement-that-activates-when-a-shape-hits-the-outer-part-of-another-shape-or-as-some-people-may-call-it-the-outline/34287)

<div class="topic-metadata">

**Author:** [@parichko](https://discourse.processing.org/u/parichko)\
**Replies:** 2\
**Last updated:** [December 25, 2021, 1:16pm UTC](https://discourse.processing.org/t/what-is-the-best-way-to-make-a-if-statement-that-activates-when-a-shape-hits-the-outer-part-of-another-shape-or-as-some-people-may-call-it-the-outline/34287 "2021-12-25T13:16:46Z")

</div>

Lets say you are making a game where if a moving circle hits a rect it bounces off . Now the hard thing for me is to make the ball to do something if it hits the outline of the shape cause I need to make if x \> x-width/2…

---

## [Storing data into an array (processing.sound)](https://discourse.processing.org/t/storing-data-into-an-array-processing-sound/34150)

<div class="topic-metadata">

**Author:** [@rebeccajkaye](https://discourse.processing.org/u/rebeccajkaye)\
**Replies:** 13\
**Last updated:** [December 24, 2021, 5:34pm UTC](https://discourse.processing.org/t/storing-data-into-an-array-processing-sound/34150 "2021-12-24T17:34:36Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hello I’m trying to store data from a sound file into an array so that I can use it to draw with. I’ve come a bit further on with my problem bu…

---

## [Draw() inside a class](https://discourse.processing.org/t/draw-inside-a-class/34207)

<div class="topic-metadata">

**Author:** [@Skycstls](https://discourse.processing.org/u/Skycstls)\
**Replies:** 2\
**Last updated:** [December 24, 2021, 2:39pm UTC](https://discourse.processing.org/t/draw-inside-a-class/34207 "2021-12-24T14:39:16Z")

</div>

Hey Processing forum! I’ve been looking the Ani library for animation, was scrolling through the examples for using it and saw this class: class Cirlce { float x = random(0,width); float y = random(0,height); int…

---

## [Snake eating the apple](https://discourse.processing.org/t/snake-eating-the-apple/34275)

<div class="topic-metadata">

**Author:** [@f.y](https://discourse.processing.org/u/f.y)\
**Replies:** 0\
**Last updated:** [December 24, 2021, 8:08am UTC](https://discourse.processing.org/t/snake-eating-the-apple/34275 "2021-12-24T08:08:33Z")

</div>

Hello everyone, I need some help with the code I am writing. this is a simple snake game but I don\`t know how to make the snake eat the apples besides there is one more problem. whenever the snake moves from left to rig…

---

## [P5.js Soft body dynamics on text](https://discourse.processing.org/t/p5-js-soft-body-dynamics-on-text/34225)

<div class="topic-metadata">

**Author:** [@Didicw93](https://discourse.processing.org/u/Didicw93)\
**Replies:** 1\
**Last updated:** [December 24, 2021, 8:05am UTC](https://discourse.processing.org/t/p5-js-soft-body-dynamics-on-text/34225 "2021-12-24T08:05:44Z")

</div>

I’m trying to figure out how to apply the basic soft dynamic in the reference page of P5.js on to typography/text. at the moment i think that the only option is to draw the shapes of the letters via “beginShape()” any s…

---

## [Early preview of WinUI - a library for rendering p5.js sketches in windows on a canvas](https://discourse.processing.org/t/early-preview-of-winui-a-library-for-rendering-p5-js-sketches-in-windows-on-a-canvas/27895)

<div class="topic-metadata">

**Author:** [@codeguppy](https://discourse.processing.org/u/codeguppy)\
**Replies:** 2\
**Last updated:** [December 24, 2021, 4:18am UTC](https://discourse.processing.org/t/early-preview-of-winui-a-library-for-rendering-p5-js-sketches-in-windows-on-a-canvas/27895 "2021-12-24T04:18:32Z")

</div>

Hello talented processing / p5.js developers, I want to offer you an early preview of WinUI - a p5.js based library for creating windowed programs. Remember that this is an early preview – but I’m super interested in y…

---

## [Need help with a health system in a game i'm making](https://discourse.processing.org/t/need-help-with-a-health-system-in-a-game-im-making/33687)

<div class="topic-metadata">

**Author:** [@UltimateDoug9](https://discourse.processing.org/u/UltimateDoug9)\
**Replies:** 5\
**Last updated:** [December 23, 2021, 11:23pm UTC](https://discourse.processing.org/t/need-help-with-a-health-system-in-a-game-im-making/33687 "2021-12-23T23:23:34Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Making a game of my computer studies class and i’m struggling to make a health system with just variables and if statement (that 's all were allowe…

---

## [Img.line() crash in Safari](https://discourse.processing.org/t/img-line-crash-in-safari/34251)

<div class="topic-metadata">

**Author:** [@roberthodgin](https://discourse.processing.org/u/roberthodgin)\
**Replies:** 1\
**Last updated:** [December 23, 2021, 8:31pm UTC](https://discourse.processing.org/t/img-line-crash-in-safari/34251 "2021-12-23T20:31:00Z")

</div>

Hello. I am working on a p5js piece and having good success. Everything works beautifully in Chrome on desktop and mobile. However, in Safari and on iPhone, the project crashes. I have narrowed it down to one line: bg.l…

---

## [Can you use eval() in p5js?](https://discourse.processing.org/t/can-you-use-eval-in-p5js/34183)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 9\
**Last updated:** [December 23, 2021, 8:24pm UTC](https://discourse.processing.org/t/can-you-use-eval-in-p5js/34183 "2021-12-23T20:24:05Z")

</div>

is the eval() function available for p5js?

---

## [Synthetic variable assignment -- this\[String+number\] (IntDict)](https://discourse.processing.org/t/synthetic-variable-assignment-this-string-number-intdict/34267)

<div class="topic-metadata">

**Author:** [@mrbbp](https://discourse.processing.org/u/mrbbp)\
**Replies:** 7\
**Last updated:** [December 23, 2021, 4:09pm UTC](https://discourse.processing.org/t/synthetic-variable-assignment-this-string-number-intdict/34267 "2021-12-23T16:09:33Z")

</div>

Hello, i suppose it’s a newb question and sorry for that. i don’t know how to qualify in english (no more in french)… a composite variable name, a synthetic variable name??? in js your can assign a “synthetic” var na…

---

## [Snake game eating the apples](https://discourse.processing.org/t/snake-game-eating-the-apples/34264)

<div class="topic-metadata">

**Author:** [@f.y](https://discourse.processing.org/u/f.y)\
**Replies:** 0\
**Last updated:** [December 23, 2021, 9:15am UTC](https://discourse.processing.org/t/snake-game-eating-the-apples/34264 "2021-12-23T09:15:00Z")

</div>

import processing.core.\*; public class Problem04 extends PApplet { float scale = height / 18f; float foodX; float foodY; float circleX; float circleY; float circleR; int score = 0; String scoreTxt = "Score: " + …

---

## [I want to sort many arrays in many different ways](https://discourse.processing.org/t/i-want-to-sort-many-arrays-in-many-different-ways/34249)

<div class="topic-metadata">

**Author:** [@jazz](https://discourse.processing.org/u/jazz)\
**Replies:** 3\
**Last updated:** [December 22, 2021, 9:22pm UTC](https://discourse.processing.org/t/i-want-to-sort-many-arrays-in-many-different-ways/34249 "2021-12-22T21:22:11Z")

</div>

for one of my projects, I have two arrays, one storing X coordinates, and one with Y coordinates. my goal is to sort the X coordinates from least to greatest using the “sort” function. the problem is, then none of the X…

---

## [5 Bit Barker Code](https://discourse.processing.org/t/5-bit-barker-code/31141)

<div class="topic-metadata">

**Author:** [@jafal](https://discourse.processing.org/u/jafal)\
**Replies:** 24\
**Last updated:** [December 22, 2021, 5:05pm UTC](https://discourse.processing.org/t/5-bit-barker-code/31141 "2021-12-22T17:05:24Z")

</div>

hi all I want to perform multiplication and addition for this array so that the result is as follows thanks in advance int \[\] intArray = new int\[\] {1, 1, 1,-1, 1}; println("Original Array:"); for (int i=0; i\<intArra…

[Previous page](https://discourse.processing.org/latest.md?no_subcategories=false&page=166)

[Next page](https://discourse.processing.org/latest.md?no_subcategories=false&page=168)
