# Coding Questions

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

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

**Page:** 13

---

## [Fullscreen on a 2nd Monitor fails in macOS (P3D Renderer)](https://discourse.processing.org/t/fullscreen-on-a-2nd-monitor-fails-in-macos-p3d-renderer/41930)

<div class="topic-metadata">

**Author:** [@robotandproud](https://discourse.processing.org/u/robotandproud)\
**Replies:** 1\
**Last updated:** [May 18, 2023, 12:51am UTC](https://discourse.processing.org/t/fullscreen-on-a-2nd-monitor-fails-in-macos-p3d-renderer/41930 "2023-05-18T00:51:25Z")

</div>

I’m attempting to run the following example which is based on the Processing Reference to run a sketch in fullscreen mode on a 2nd monitor. It works fine with the default renderer, however when I changed the fullScreen()…

---

## [Sampling a pseudo rotation into a perfect rotation. It works! (but not from everywhere)](https://discourse.processing.org/t/sampling-a-pseudo-rotation-into-a-perfect-rotation-it-works-but-not-from-everywhere/42013)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 0\
**Last updated:** [May 16, 2023, 9:55am UTC](https://discourse.processing.org/t/sampling-a-pseudo-rotation-into-a-perfect-rotation-it-works-but-not-from-everywhere/42013 "2023-05-16T09:55:38Z")

</div>

Hi everyones :wink: This code allows you to record mouse as a movement of rotation and play it back using interpolation to smooth the movement between recorded samples. Morever, If your circle pass through the first po…

---

## [How can i create Brushes for drawing?](https://discourse.processing.org/t/how-can-i-create-brushes-for-drawing/41990)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 6\
**Last updated:** [May 15, 2023, 7:48pm UTC](https://discourse.processing.org/t/how-can-i-create-brushes-for-drawing/41990 "2023-05-15T19:48:21Z")

</div>

I want to make brushes for my drawing software, i have code, but its kinda bad and not working correctly. The problem is if i put down a image of the brush every frame, it will not work when moving the mouse fast. I tri…

---

## [Issue trying to draw a cylinder](https://discourse.processing.org/t/issue-trying-to-draw-a-cylinder/41984)

<div class="topic-metadata">

**Author:** [@alex119](https://discourse.processing.org/u/alex119)\
**Replies:** 2\
**Last updated:** [May 13, 2023, 6:44pm UTC](https://discourse.processing.org/t/issue-trying-to-draw-a-cylinder/41984 "2023-05-13T18:44:14Z")

</div>

Hello, I am trying to draw a shape, like a cylinder, but the output is something like this: As you see, the last point is not matching the first point and I can’t figure out what I am doing wrong. Here is the code …

---

## [Possible to make a lot of statements into one?](https://discourse.processing.org/t/possible-to-make-a-lot-of-statements-into-one/41904)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 25\
**Last updated:** [May 10, 2023, 4:15pm UTC](https://discourse.processing.org/t/possible-to-make-a-lot-of-statements-into-one/41904 "2023-05-10T16:15:56Z")

</div>

Can i replace this, with something easier? mabye terrainBase\[playerxpos+ix-1\]\[playerypos+iy\] == 0 && terrainBase\[playerxpos+ix-1\]\[playerypos+iy\] == 3 && terrainBase\[playerxpos+ix-1\]\[playerypos+iy\] == 4 && terrainBase\[pl…

---

## [loadJSONObject() fails to load compressed JSON provided by an API](https://discourse.processing.org/t/loadjsonobject-fails-to-load-compressed-json-provided-by-an-api/41919)

<div class="topic-metadata">

**Author:** [@fabwoj](https://discourse.processing.org/u/fabwoj)\
**Replies:** 2\
**Last updated:** [May 5, 2023, 5:42pm UTC](https://discourse.processing.org/t/loadjsonobject-fails-to-load-compressed-json-provided-by-an-api/41919 "2023-05-05T17:42:32Z")

</div>

Hi, I had to use an API which now send compressed json. loadJSONObject() fails to get thoses kind of json. I did this workaround which seems to work. import java.net.\*; import java.io.\*; import java.util.zip.GZIPInpu…

---

## [How can I create a walker with a finite trail?](https://discourse.processing.org/t/how-can-i-create-a-walker-with-a-finite-trail/41674)

<div class="topic-metadata">

**Author:** [@benjamin-thomas](https://discourse.processing.org/u/benjamin-thomas)\
**Replies:** 12\
**Last updated:** [May 2, 2023, 10:57am UTC](https://discourse.processing.org/t/how-can-i-create-a-walker-with-a-finite-trail/41674 "2023-05-02T10:57:31Z")

</div>

Given this sketch: Walker walker; void settings() { size(640, 360); } void setup() { windowTitle("Perlin Noise Walker"); background(0); walker = new Walker(); } void draw() { walker.step(); walker.render()…

---

## [JogAmp Fat breaks Processing](https://discourse.processing.org/t/jogamp-fat-breaks-processing/41866)

<div class="topic-metadata">

**Author:** [@turke1034](https://discourse.processing.org/u/turke1034)\
**Replies:** 1\
**Last updated:** [April 29, 2023, 10:45am UTC](https://discourse.processing.org/t/jogamp-fat-breaks-processing/41866 "2023-04-29T10:45:50Z")

</div>

Hi, I am using processing core jar and jogamp fat for my java game. But today I tried to update them, and now the new jogamp fat jar breaks it! Error: The sketch has been resized from 720x480 to 900x600 by the operatin…

---

## [Loading JSON array in Flask](https://discourse.processing.org/t/loading-json-array-in-flask/41858)

<div class="topic-metadata">

**Author:** [@turobiter](https://discourse.processing.org/u/turobiter)\
**Replies:** 0\
**Last updated:** [April 27, 2023, 8:33pm UTC](https://discourse.processing.org/t/loading-json-array-in-flask/41858 "2023-04-27T20:33:00Z")

</div>

Hi! I’m working on a website using Python and Flask. One of the pages needs to render a processing sketch, with the fill() parameter based on data in a list that is created in the Flask project file app.py. Basically, in…

---

## [Parallel lines in 3D space](https://discourse.processing.org/t/parallel-lines-in-3d-space/41801)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 18\
**Last updated:** [April 27, 2023, 2:40pm UTC](https://discourse.processing.org/t/parallel-lines-in-3d-space/41801 "2023-04-27T14:40:43Z")

</div>

I have a line in 3D space. The line is not parallel to any of the three axes (X, Y, Z). I know the 3D coordinates of point 0 and point 1. How would I use Processing to find the coordinates of a parallel line? By paralle…

---

## [How to change background color for just a short period of time after pressing a key?](https://discourse.processing.org/t/how-to-change-background-color-for-just-a-short-period-of-time-after-pressing-a-key/41811)

<div class="topic-metadata">

**Author:** [@Rebello](https://discourse.processing.org/u/Rebello)\
**Replies:** 4\
**Last updated:** [April 26, 2023, 10:39pm UTC](https://discourse.processing.org/t/how-to-change-background-color-for-just-a-short-period-of-time-after-pressing-a-key/41811 "2023-04-26T22:39:02Z")

</div>

hello everyone. i want to press the enter key and than change the color of the screen to green for 1 second. After that 1 second it should go back to white. And I want to do that in the keyPressed() method. My work so …

---

## [How to skip a method in Processing](https://discourse.processing.org/t/how-to-skip-a-method-in-processing/41837)

<div class="topic-metadata">

**Author:** [@ImLandfall](https://discourse.processing.org/u/ImLandfall)\
**Replies:** 2\
**Last updated:** [April 26, 2023, 7:45pm UTC](https://discourse.processing.org/t/how-to-skip-a-method-in-processing/41837 "2023-04-26T19:45:59Z")

</div>

So I thought I could use " ! " in some way but is there a function to skip a method or something like it? if(player.isDestroyed == true) { } and if it is true, I want it to skip drawplayer.

---

## [Make Objects in Different Classes Collide?](https://discourse.processing.org/t/make-objects-in-different-classes-collide/41816)

<div class="topic-metadata">

**Author:** [@ImLandfall](https://discourse.processing.org/u/ImLandfall)\
**Replies:** 7\
**Last updated:** [April 26, 2023, 7:13pm UTC](https://discourse.processing.org/t/make-objects-in-different-classes-collide/41816 "2023-04-26T19:13:05Z")

</div>

ArrayList ants = new ArrayList(); int NumAnts = 30; PImage bg; boolean keys; Player player; void setup() { size(600, 600); frameRate(60); player = new Player(); bg = loadImage(“grass.png”); for (int i = 0; i \<…

---

## [About steering force,I'm studying The Nature of Code by Daniel Shiffman.Why does the code run with nothing?](https://discourse.processing.org/t/about-steering-force-im-studying-the-nature-of-code-by-daniel-shiffman-why-does-the-code-run-with-nothing/41823)

<div class="topic-metadata">

**Author:** [@jiajia](https://discourse.processing.org/u/jiajia)\
**Replies:** 2\
**Last updated:** [April 25, 2023, 10:32am UTC](https://discourse.processing.org/t/about-steering-force-im-studying-the-nature-of-code-by-daniel-shiffman-why-does-the-code-run-with-nothing/41823 "2023-04-25T10:32:40Z")

</div>

class Vehicle{ PVector location; PVector velocity; PVector acceleration; float r; float maxforce; float maxspeed; Vehicle(float x,float y){ acceleration = new PVector(0,0); velocity = new PVec…

---

## [Custom waveforms in beads](https://discourse.processing.org/t/custom-waveforms-in-beads/41803)

<div class="topic-metadata">

**Author:** [@mangopusher](https://discourse.processing.org/u/mangopusher)\
**Replies:** 1\
**Last updated:** [April 23, 2023, 5:59pm UTC](https://discourse.processing.org/t/custom-waveforms-in-beads/41803 "2023-04-23T17:59:04Z")

</div>

hey I’m new to the forum so please apologize when this is answered elsewhere, but i couldnt find any help online. I’m trying to change the waveform buffer of a beads, i can change the array directly but as soon as I’m t…

---

## [Code stalling operating a Stream Deck](https://discourse.processing.org/t/code-stalling-operating-a-stream-deck/41800)

<div class="topic-metadata">

**Author:** [@mason77225](https://discourse.processing.org/u/mason77225)\
**Replies:** 0\
**Last updated:** [April 23, 2023, 11:40am UTC](https://discourse.processing.org/t/code-stalling-operating-a-stream-deck/41800 "2023-04-23T11:40:01Z")

</div>

Hello, and thanks for reading. I’m currently working on some code to control a Streamdeck within processing. It’s been working fine for months but now I get this error whenever I change pages on the deck. I can’t seem to…

---

## [Possible to save 2D array and load it?](https://discourse.processing.org/t/possible-to-save-2d-array-and-load-it/41783)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 3\
**Last updated:** [April 22, 2023, 5:05pm UTC](https://discourse.processing.org/t/possible-to-save-2d-array-and-load-it/41783 "2023-04-22T17:05:58Z")

</div>

Im making a game. im confused, because i dont know how i could make it better. the variables terrainwidth and terrainheight can be any value and that cant be ignored! the code that saves it can be modified, please help …

---

## [Artificial intelligence for pong](https://discourse.processing.org/t/artificial-intelligence-for-pong/41713)

<div class="topic-metadata">

**Author:** [@hokuto](https://discourse.processing.org/u/hokuto)\
**Replies:** 5\
**Last updated:** [April 15, 2023, 7:16am UTC](https://discourse.processing.org/t/artificial-intelligence-for-pong/41713 "2023-04-15T07:16:57Z")

</div>

I’m trying to do the pong, I haven’t added the collision with the rackets yet because I’m trying to understand the collisions. What I would like to know is how to make the racket that controls the cpu have a little inte…

---

## [Game pause and return key issues](https://discourse.processing.org/t/game-pause-and-return-key-issues/41702)

<div class="topic-metadata">

**Author:** [@hokuto](https://discourse.processing.org/u/hokuto)\
**Replies:** 6\
**Last updated:** [April 13, 2023, 7:04pm UTC](https://discourse.processing.org/t/game-pause-and-return-key-issues/41702 "2023-04-13T19:04:41Z")

</div>

I have an application that manages the title screen and the game screen. I would like to know how to do so that when it is in the game screen and the “p” key is pressed, the game is paused and when it is paused and it is…

---

## [JFrame does not show top bar after it is exported as application](https://discourse.processing.org/t/jframe-does-not-show-top-bar-after-it-is-exported-as-application/41668)

<div class="topic-metadata">

**Author:** [@Martin\_The\_Sun](https://discourse.processing.org/u/Martin_The_Sun)\
**Replies:** 3\
**Last updated:** [April 13, 2023, 7:56am UTC](https://discourse.processing.org/t/jframe-does-not-show-top-bar-after-it-is-exported-as-application/41668 "2023-04-13T07:56:43Z")

</div>

Hi, my program displays an interface inside a JFrame and this JFrame has a top bar as what an usual JFrame has. When I used Processing 3, this top bar can be seen either when i run the program inside Processing or export…

---

## [Shape generator help (Armin Hofmann’s ‘rubber band’ shape generator) #2](https://discourse.processing.org/t/shape-generator-help-armin-hofmann-s-rubber-band-shape-generator-2/41693)

<div class="topic-metadata">

**Author:** [@SvenHW](https://discourse.processing.org/u/SvenHW)\
**Replies:** 1\
**Last updated:** [April 13, 2023, 1:28am UTC](https://discourse.processing.org/t/shape-generator-help-armin-hofmann-s-rubber-band-shape-generator-2/41693 "2023-04-13T01:28:35Z")

</div>

Can someone help me with my code? I tried to auto generate the shapes from Armin Hofmann but don’t know how to get further. This is what I have now: This his how it should be:

---

## [Chess board overfilling height](https://discourse.processing.org/t/chess-board-overfilling-height/41695)

<div class="topic-metadata">

**Author:** [@cornelius](https://discourse.processing.org/u/cornelius)\
**Replies:** 8\
**Last updated:** [April 12, 2023, 1:04pm UTC](https://discourse.processing.org/t/chess-board-overfilling-height/41695 "2023-04-12T13:04:18Z")

</div>

Hi I’ve just started using processing. I’ll put the code below, but first the problem. I have to setup a 14x14 chessboard in a 672x672 board (plus a 120 pixel-wide sidebar, where each tile is 48 pixels square. I set up…

---

## [How can i improve the performance of this code?](https://discourse.processing.org/t/how-can-i-improve-the-performance-of-this-code/41645)

<div class="topic-metadata">

**Author:** [@Drachenbauer](https://discourse.processing.org/u/Drachenbauer)\
**Replies:** 2\
**Last updated:** [April 9, 2023, 7:50pm UTC](https://discourse.processing.org/t/how-can-i-improve-the-performance-of-this-code/41645 "2023-04-09T19:50:08Z")

</div>

Hello i made this work on recent Processing 4: yoyleCityWords But rendering the city in full style (press “T” while running the code) takes about a minute. it takes a red and green picture of 120 pixels width and 80 p…

---

## [Group SVG loaded shape](https://discourse.processing.org/t/group-svg-loaded-shape/41636)

<div class="topic-metadata">

**Author:** [@mrbbp](https://discourse.processing.org/u/mrbbp)\
**Replies:** 5\
**Last updated:** [April 7, 2023, 7:37am UTC](https://discourse.processing.org/t/group-svg-loaded-shape/41636 "2023-04-07T07:37:24Z")

</div>

Hello, i’m playing with drawn letters in svg, and put together to build words. Something to make poster drawn by an axidraw I would like to group letters to manipulate group easily. (center word in the screen, etc, et…

---

## [What is used instead of \`void processing.core.PVector.add(processing.core.PVector)\` now?](https://discourse.processing.org/t/what-is-used-instead-of-void-processing-core-pvector-add-processing-core-pvector-now/41639)

<div class="topic-metadata">

**Author:** [@Drachenbauer](https://discourse.processing.org/u/Drachenbauer)\
**Replies:** 2\
**Last updated:** [April 6, 2023, 5:36pm UTC](https://discourse.processing.org/t/what-is-used-instead-of-void-processing-core-pvector-add-processing-core-pvector-now/41639 "2023-04-06T17:36:04Z")

</div>

\[Video about image to 3d-city generator(https://www.youtube.com/watch?v=y0nsXiI\_I9c) I am interested in the application, that he shows here and he shares it for free through github (link in video-description). In his v…

---

## [2 PApplets synchronization](https://discourse.processing.org/t/2-papplets-synchronization/41623)

<div class="topic-metadata">

**Author:** [@gerome](https://discourse.processing.org/u/gerome)\
**Replies:** 2\
**Last updated:** [April 6, 2023, 11:21am UTC](https://discourse.processing.org/t/2-papplets-synchronization/41623 "2023-04-06T11:21:48Z")

</div>

In my Java programme (running on Win10) I have several PApplets created with runSketch(). Sometimes an error occurs (see below). I suspect it is caused by one thread being called before some precomputations in another th…

---

## [How do I animate this ring without the values going crazy after 20 frames?](https://discourse.processing.org/t/how-do-i-animate-this-ring-without-the-values-going-crazy-after-20-frames/41587)

<div class="topic-metadata">

**Author:** [@JamOne](https://discourse.processing.org/u/JamOne)\
**Replies:** 4\
**Last updated:** [April 4, 2023, 12:39pm UTC](https://discourse.processing.org/t/how-do-i-animate-this-ring-without-the-values-going-crazy-after-20-frames/41587 "2023-04-04T12:39:08Z")

</div>

The first 20 frames are ok, but after that the range of the noiseX and noiseY values gets to big. Yet I need these values being multiplied by pos so the animation is concentric and does not move into one direction. Any …

---

## [Classes and subclases](https://discourse.processing.org/t/classes-and-subclases/41583)

<div class="topic-metadata">

**Author:** [@carl\_extends\_code](https://discourse.processing.org/u/carl_extends_code)\
**Replies:** 2\
**Last updated:** [April 3, 2023, 3:53pm UTC](https://discourse.processing.org/t/classes-and-subclases/41583 "2023-04-03T15:53:17Z")

</div>

Hi, Im working on a smal game and I have different enemies. They all have the same amount of animation frames and therfore I thought that there was a possibility to use an Animation class and let all the monsters extend…

---

## [Make a specific PGraphics not smooth in P2D](https://discourse.processing.org/t/make-a-specific-pgraphics-not-smooth-in-p2d/41560)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 8\
**Last updated:** [April 3, 2023, 2:37pm UTC](https://discourse.processing.org/t/make-a-specific-pgraphics-not-smooth-in-p2d/41560 "2023-04-03T14:37:17Z")

</div>

Does anybody know if theres a way to render a pgraphics that is mabye 16x16 px so it looks looks pixelated and not smooth but just the specific one?

---

## [Would it be possible to create a triangular application?](https://discourse.processing.org/t/would-it-be-possible-to-create-a-triangular-application/41564)

<div class="topic-metadata">

**Author:** [@nanto2016](https://discourse.processing.org/u/nanto2016)\
**Replies:** 3\
**Last updated:** [April 2, 2023, 2:44pm UTC](https://discourse.processing.org/t/would-it-be-possible-to-create-a-triangular-application/41564 "2023-04-02T14:44:06Z")

</div>

So I thought of trying to create some cellular automata or simulation, whatever, and I thought of making one triangular. I guess it would be pretty cool to make a triangular 2D array somehow…? I might find a way to do th…

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

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