# Coding Questions

**URL:** https://discourse.processing.org/c/processing/processing-questions/15.md?page=7

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

**Page:** 8

---

## [App Icon Processing 4](https://discourse.processing.org/t/app-icon-processing-4/43918)

<div class="topic-metadata">

**Author:** [@Edenstudent](https://discourse.processing.org/u/Edenstudent)\
**Replies:** 5\
**Last updated:** [February 21, 2024, 6:57am UTC](https://discourse.processing.org/t/app-icon-processing-4/43918 "2024-02-21T06:57:54Z")

</div>

I’m trying to set the icon for the application (and in the task bar) in Processing4, and I have this: PImage icon = loadImage("icon.png"); surface.setIcon(icon); The image is 778x758; it doesn’t show up though in t…

---

## [Reducing points in polygon](https://discourse.processing.org/t/reducing-points-in-polygon/13590)

<div class="topic-metadata">

**Author:** [@jeffthompson](https://discourse.processing.org/u/jeffthompson)\
**Replies:** 6\
**Last updated:** [February 19, 2024, 4:07am UTC](https://discourse.processing.org/t/reducing-points-in-polygon/13590 "2024-02-19T04:07:53Z")

</div>

I’ve been working with this example code over on the old forum, which reduces the number of points in a polygon using the Ramer-Douglas-Peucker algorithm. It works great for my purposes, but for one weird thing: it creat…

---

## [Lerp flow field and attractor](https://discourse.processing.org/t/lerp-flow-field-and-attractor/43934)

<div class="topic-metadata">

**Author:** [@Leo\_Aguiar](https://discourse.processing.org/u/Leo_Aguiar)\
**Replies:** 1\
**Last updated:** [February 18, 2024, 4:44pm UTC](https://discourse.processing.org/t/lerp-flow-field-and-attractor/43934 "2024-02-18T16:44:47Z")

</div>

Hello forum, I am looking for help on an issue where only one object is being affected by an attractor. I am building on top of different tutorials I have found on YouTube. The sketch basically has a noise field that is …

---

## [Numpad keycodes are acting weird?](https://discourse.processing.org/t/numpad-keycodes-are-acting-weird/43917)

<div class="topic-metadata">

**Author:** [@Edenstudent](https://discourse.processing.org/u/Edenstudent)\
**Replies:** 5\
**Last updated:** [February 16, 2024, 7:28am UTC](https://discourse.processing.org/t/numpad-keycodes-are-acting-weird/43917 "2024-02-16T07:28:48Z")

</div>

So, I know that the keyCodes are different for the numpad and that they actually if you have NumLock on or off. I have a little program that gets the numbers for me: void setup() { } void draw() { } void keyPressed() …

---

## [Getting the window position in P2D](https://discourse.processing.org/t/getting-the-window-position-in-p2d/43543)

<div class="topic-metadata">

**Author:** [@Noodlybanan](https://discourse.processing.org/u/Noodlybanan)\
**Replies:** 3\
**Last updated:** [February 15, 2024, 6:59am UTC](https://discourse.processing.org/t/getting-the-window-position-in-p2d/43543 "2024-02-15T06:59:14Z")

</div>

Hello :slight\_smile: I want to get the window position of a window to if the window is offscreen correct it & correctly implement 3d movement (rotation with mouse). However, the versions i saw don’t work on P2D, P3D or …

---

## [Mipmaps in OpenGL](https://discourse.processing.org/t/mipmaps-in-opengl/42315)

<div class="topic-metadata">

**Author:** [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Replies:** 2\
**Last updated:** [February 13, 2024, 8:18pm UTC](https://discourse.processing.org/t/mipmaps-in-opengl/42315 "2024-02-13T20:18:52Z")

</div>

I have the following image: And the following sketch: PImage img; PGraphics big; PGraphics small; boolean from\_big\_pg = true; void setup() { size(320, 180, P2D); img = loadImage("big.png"); big = createGraph…

---

## [String art in Processing. What I've got so far. SOLVED](https://discourse.processing.org/t/string-art-in-processing-what-ive-got-so-far-solved/43886)

<div class="topic-metadata">

**Author:** [@Matty27](https://discourse.processing.org/u/Matty27)\
**Replies:** 2\
**Last updated:** [February 11, 2024, 5:54pm UTC](https://discourse.processing.org/t/string-art-in-processing-what-ive-got-so-far-solved/43886 "2024-02-11T17:54:14Z")

</div>

Good afternoon all. I’m trying to use processing to create some “string art”, which is overlapping lines that form curves. The code I’ve got is below. I’ve tried to make it so that I don’t have hard-coded values, meanin…

---

## [Start Win Explorer with folder](https://discourse.processing.org/t/start-win-explorer-with-folder/41901)

<div class="topic-metadata">

**Author:** [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Replies:** 4\
**Last updated:** [February 5, 2024, 4:52pm UTC](https://discourse.processing.org/t/start-win-explorer-with-folder/41901 "2024-02-05T16:52:39Z")

</div>

hello all, how can I start Win explorer with explorer? I read this: Parameter des Windows Explorers "explorer.exe" - Windows FAQ but this doesn’t work launch ( "explorer.exe"+ " /n," + sketchPath("")+…

---

## [Help with a drop and drag code (drag 4 images)](https://discourse.processing.org/t/help-with-a-drop-and-drag-code-drag-4-images/43650)

<div class="topic-metadata">

**Author:** [@Codedstuff](https://discourse.processing.org/u/Codedstuff)\
**Replies:** 1\
**Last updated:** [January 8, 2024, 4:49pm UTC](https://discourse.processing.org/t/help-with-a-drop-and-drag-code-drag-4-images/43650 "2024-01-08T16:49:06Z")

</div>

HI :slight\_smile: I’m having problem with understanding this array I have four pictures loaded, but when i open it only 3 of them shows I also want to add some extra pictures in the array, but it wont let me. In the …

---

## [Pixelation problem](https://discourse.processing.org/t/pixelation-problem/43773)

<div class="topic-metadata">

**Author:** [@Philippe1](https://discourse.processing.org/u/Philippe1)\
**Replies:** 0\
**Last updated:** [January 27, 2024, 10:31am UTC](https://discourse.processing.org/t/pixelation-problem/43773 "2024-01-27T10:31:08Z")

</div>

Hello I am animating bezier curves and I have pixelation during animation. Even with the “smooth” command this persists. It’s even worse when I record it on video. I work in P3D mode. Is there another mode that woul…

---

## [Problem to make two Bezier curves evolve independently of each other](https://discourse.processing.org/t/problem-to-make-two-bezier-curves-evolve-independently-of-each-other/43750)

<div class="topic-metadata">

**Author:** [@Philippe1](https://discourse.processing.org/u/Philippe1)\
**Replies:** 2\
**Last updated:** [January 27, 2024, 9:42am UTC](https://discourse.processing.org/t/problem-to-make-two-bezier-curves-evolve-independently-of-each-other/43750 "2024-01-27T09:42:50Z")

</div>

Hello, I would like to evolve two Bezier curves independently. I would like both to have a rotation in the center of the screen. However, the second has a completely different behavior. What is the coding so that two…

---

## [Simple collision game. the ellipse strange moves](https://discourse.processing.org/t/simple-collision-game-the-ellipse-strange-moves/43765)

<div class="topic-metadata">

**Author:** [@doni](https://discourse.processing.org/u/doni)\
**Replies:** 1\
**Last updated:** [January 26, 2024, 9:33am UTC](https://discourse.processing.org/t/simple-collision-game-the-ellipse-strange-moves/43765 "2024-01-26T09:33:18Z")

</div>

hi. i want to create simple game where i have ellipse moving randomly and line at the bottom of the screen and its move along mouse X axis to void the ellipse from touch the bottom screen end. but bellow code cause the e…

---

## [Volume with lines](https://discourse.processing.org/t/volume-with-lines/43759)

<div class="topic-metadata">

**Author:** [@humano](https://discourse.processing.org/u/humano)\
**Replies:** 1\
**Last updated:** [January 25, 2024, 4:45pm UTC](https://discourse.processing.org/t/volume-with-lines/43759 "2024-01-25T16:45:34Z")

</div>

Hi there! I am drawing this origami folds simulating volume with a loop of lines in every side. But second side’s loop is not complete as I was expecting, following the red line you can see on the picture. Could anyone p…

---

## [Cannot stop glitching through block](https://discourse.processing.org/t/cannot-stop-glitching-through-block/43752)

<div class="topic-metadata">

**Author:** [@WillyGrz](https://discourse.processing.org/u/WillyGrz)\
**Replies:** 1\
**Last updated:** [January 24, 2024, 6:25pm UTC](https://discourse.processing.org/t/cannot-stop-glitching-through-block/43752 "2024-01-24T18:25:15Z")

</div>

Lines 203-215 seem to be the problem. The square is 30 px in length, and the obstacle is 160. I’m trying to get it so that you cannot move into the square. It works when I just have lines 203-208, but when changing the 8…

---

## [Deformed circles](https://discourse.processing.org/t/deformed-circles/43703)

<div class="topic-metadata">

**Author:** [@humano](https://discourse.processing.org/u/humano)\
**Replies:** 18\
**Last updated:** [January 24, 2024, 5:22am UTC](https://discourse.processing.org/t/deformed-circles/43703 "2024-01-24T05:22:22Z")

</div>

Hi there! I am trying to draw something as this made by hand circles with processing. I know this two ways, but deforming an ellipse is still too geometric and rounded corners of a rect is not bad but not as spontaneous …

---

## [Exporting to SVG for use in pen plotting](https://discourse.processing.org/t/exporting-to-svg-for-use-in-pen-plotting/42395)

<div class="topic-metadata">

**Author:** [@PCwigwam](https://discourse.processing.org/u/PCwigwam)\
**Replies:** 7\
**Last updated:** [January 18, 2024, 2:12am UTC](https://discourse.processing.org/t/exporting-to-svg-for-use-in-pen-plotting/42395 "2024-01-18T02:12:51Z")

</div>

Hi all, i’m a few weeks into learning coding/Processing but am struggling a bit with taking my processing creations and exporting them to SVG files. Below is a program that i’ve written up in Processing and i’d really li…

---

## [Trouble making ellipses in curving line non-overlapping](https://discourse.processing.org/t/trouble-making-ellipses-in-curving-line-non-overlapping/43709)

<div class="topic-metadata">

**Author:** [@druuupppa](https://discourse.processing.org/u/druuupppa)\
**Replies:** 0\
**Last updated:** [January 17, 2024, 11:53pm UTC](https://discourse.processing.org/t/trouble-making-ellipses-in-curving-line-non-overlapping/43709 "2024-01-17T23:53:23Z")

</div>

Hello! I need some help with this code with which I have been making loop-d-loop lines of ellipses. I am having a lot of trouble getting them to draw without overlapping. Any help would be appreciated! Warmly, Druppa …

---

## [Why does it get stuck 'up'](https://discourse.processing.org/t/why-does-it-get-stuck-up/43707)

<div class="topic-metadata">

**Author:** [@WillyGrz](https://discourse.processing.org/u/WillyGrz)\
**Replies:** 4\
**Last updated:** [January 17, 2024, 5:26pm UTC](https://discourse.processing.org/t/why-does-it-get-stuck-up/43707 "2024-01-17T17:26:17Z")

</div>

Trying to make a SUPER rudamentary Geometry dash. When I jump though, it stays up. i don’t know why. float playerY; float truePY; boolean playerJump; boolean cube; boolean ship; void setup() { fullScreen(); playe…

---

## [Translate glsl to Processing glsl Code](https://discourse.processing.org/t/translate-glsl-to-processing-glsl-code/43699)

<div class="topic-metadata">

**Author:** [@Noodlybanan](https://discourse.processing.org/u/Noodlybanan)\
**Replies:** 2\
**Last updated:** [January 16, 2024, 6:47am UTC](https://discourse.processing.org/t/translate-glsl-to-processing-glsl-code/43699 "2024-01-16T06:47:16Z")

</div>

How can one translate glsl code to processing glsl code?

---

## [Creating a simple Shadow Shader](https://discourse.processing.org/t/creating-a-simple-shadow-shader/43690)

<div class="topic-metadata">

**Author:** [@Noodlybanan](https://discourse.processing.org/u/Noodlybanan)\
**Replies:** 0\
**Last updated:** [January 15, 2024, 1:29am UTC](https://discourse.processing.org/t/creating-a-simple-shadow-shader/43690 "2024-01-15T01:29:45Z")

</div>

Hello, I wanted to add shadows to my sketch, however I only found ways in P2D to use the blur shader examples, and i don’t know on how a shader could be translated to processing. This is my code (i wanted to add shadow…

---

## [Cannot move both "players" at once. Don't understand why it cannot pick up multiple (keyPressed) at once](https://discourse.processing.org/t/cannot-move-both-players-at-once-dont-understand-why-it-cannot-pick-up-multiple-keypressed-at-once/43668)

<div class="topic-metadata">

**Author:** [@WillyGrz](https://discourse.processing.org/u/WillyGrz)\
**Replies:** 7\
**Last updated:** [January 12, 2024, 2:44pm UTC](https://discourse.processing.org/t/cannot-move-both-players-at-once-dont-understand-why-it-cannot-pick-up-multiple-keypressed-at-once/43668 "2024-01-12T14:44:56Z")

</div>

float circleX; float circleY; float allColor; float bgColor; float player1Y; float player2Y; float ballSpeedX; float ballSpeedY; float player1Score; float player2Score; float trueBallSpeed; int player1ScoreView; int play…

---

## [Increasing Ellipses loop (Mandala)](https://discourse.processing.org/t/increasing-ellipses-loop-mandala/43640)

<div class="topic-metadata">

**Author:** [@humano](https://discourse.processing.org/u/humano)\
**Replies:** 28\
**Last updated:** [January 9, 2024, 11:20pm UTC](https://discourse.processing.org/t/increasing-ellipses-loop-mandala/43640 "2024-01-09T23:20:43Z")

</div>

Hello! I am trying to draw a mandala with a lot of ellipses in the middle and a few in the outer part. i mean, I am looking for something as a increasing growing separation, to get more concentration of ellioses in the c…

---

## ["text" function creates decimal numbers](https://discourse.processing.org/t/text-function-creates-decimal-numbers/43653)

<div class="topic-metadata">

**Author:** [@WillyGrz](https://discourse.processing.org/u/WillyGrz)\
**Replies:** 1\
**Last updated:** [January 8, 2024, 5:40pm UTC](https://discourse.processing.org/t/text-function-creates-decimal-numbers/43653 "2024-01-08T17:40:02Z")

</div>

I have a variable called “player1Score” in a simple Pong game I am making. “player1Score” is equal to 0 at the beginning, and is set to add 1 when scoring. The text command states “text(player1Score, ~, ~)” when using th…

---

## [Cannot invoke movingstuff() on the array type anarray.shapes\[\]](https://discourse.processing.org/t/cannot-invoke-movingstuff-on-the-array-type-anarray-shapes/43603)

<div class="topic-metadata">

**Author:** [@Charlie1](https://discourse.processing.org/u/Charlie1)\
**Replies:** 1\
**Last updated:** [January 8, 2024, 5:23pm UTC](https://discourse.processing.org/t/cannot-invoke-movingstuff-on-the-array-type-anarray-shapes/43603 "2024-01-08T17:23:50Z")

</div>

Hey Guys, do you know of a way I can overcome this error? Thanks. //shapes shapedimentions = new shapes\[2\]; //squares squaredimentions = new squares\[2\]; shapes anyshapevariable = new shapes\[4\]; void setup() { size(5…

---

## [The use of PJOGL.setIcon() for macOS](https://discourse.processing.org/t/the-use-of-pjogl-seticon-for-macos/43541)

<div class="topic-metadata">

**Author:** [@Nach](https://discourse.processing.org/u/Nach)\
**Replies:** 11\
**Last updated:** [January 4, 2024, 12:53am UTC](https://discourse.processing.org/t/the-use-of-pjogl-seticon-for-macos/43541 "2024-01-04T00:53:23Z")

</div>

Hello Processing community, I’m facing a peculiar issue with an application I’ve developed using Processing. I’ve created a custom icon for my application, but after installing it on macOS using the .pkg, upon running i…

---

## [Convert spreadsheet into academic references (Help!)](https://discourse.processing.org/t/convert-spreadsheet-into-academic-references-help/43608)

<div class="topic-metadata">

**Author:** [@isabela](https://discourse.processing.org/u/isabela)\
**Replies:** 4\
**Last updated:** [January 3, 2024, 12:45am UTC](https://discourse.processing.org/t/convert-spreadsheet-into-academic-references-help/43608 "2024-01-03T00:45:19Z")

</div>

Hello! I’m (trying) to write a simple code to transform job references written in a spreadsheet into text. I started with a test spreadsheet converted into CSV, but I’m having some formatting problems: the information al…

---

## [Pong Game Doesn't Restart](https://discourse.processing.org/t/pong-game-doesnt-restart/38890)

<div class="topic-metadata">

**Author:** [@isabela](https://discourse.processing.org/u/isabela)\
**Replies:** 6\
**Last updated:** [January 2, 2024, 10:49pm UTC](https://discourse.processing.org/t/pong-game-doesnt-restart/38890 "2024-01-02T22:49:17Z")

</div>

Hi! I am working on a Pong Game for school and wanted to add another ball when you get 5 points. The problem is, when you loose with the second ball, the game dosen’t restart. Can you help me? (the notes in the code are …

---

## [How do I write a formula that rotates a point around the coordination systems center?](https://discourse.processing.org/t/how-do-i-write-a-formula-that-rotates-a-point-around-the-coordination-systems-center/43591)

<div class="topic-metadata">

**Author:** [@Erik](https://discourse.processing.org/u/Erik)\
**Replies:** 3\
**Last updated:** [January 1, 2024, 12:45am UTC](https://discourse.processing.org/t/how-do-i-write-a-formula-that-rotates-a-point-around-the-coordination-systems-center/43591 "2024-01-01T00:45:09Z")

</div>

I have a 3D coordination system where x, y, and z dimensions span from 0 to 1000. I have a point randomly placed within these coordinates, and want it to rotate around the center (x, y and z = 500) by a given angle. I wa…

---

## [Exporting lines drawn by mouse to SVG](https://discourse.processing.org/t/exporting-lines-drawn-by-mouse-to-svg/43586)

<div class="topic-metadata">

**Author:** [@aFewScrewsLoose](https://discourse.processing.org/u/aFewScrewsLoose)\
**Replies:** 6\
**Last updated:** [December 30, 2023, 10:59pm UTC](https://discourse.processing.org/t/exporting-lines-drawn-by-mouse-to-svg/43586 "2023-12-30T22:59:00Z")

</div>

Hello, I’ve been trying to make a Processing script that: Draws a line when the mouse is pressed . Exports these lines to an .svg file. Here is my code: Codeimport processing.svg.\*; // setup runs before the main lo…

---

## [Problems with hashmap](https://discourse.processing.org/t/problems-with-hashmap/43567)

<div class="topic-metadata">

**Author:** [@hokuto](https://discourse.processing.org/u/hokuto)\
**Replies:** 2\
**Last updated:** [December 29, 2023, 6:58pm UTC](https://discourse.processing.org/t/problems-with-hashmap/43567 "2023-12-29T18:58:01Z")

</div>

Hello, I’m going to comment on the code that I’m going to show and then ask the question. I have a file called parent which has a hashmap and two classes to manage that hashmap. Then I have a player class and I shoot, …

[Previous page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=6)

[Next page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=8)
