# Coding Questions

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

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

**Page:** 17

---

## [OpenGL Shader Problem](https://discourse.processing.org/t/opengl-shader-problem/40617)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 7\
**Last updated:** [January 20, 2023, 5:40pm UTC](https://discourse.processing.org/t/opengl-shader-problem/40617 "2023-01-20T17:40:43Z")

</div>

This demo is exercise #2 in the book “Computer Graphics Programming” by Gordon & Clevenger, Third Edition. It uses openGL source code and is supposed to create a single point, 30 pixels in size, and shade it a blue colo…

---

## [fullScreen(P3D, SPAN) with 2 Monitors not working in Ubuntu](https://discourse.processing.org/t/fullscreen-p3d-span-with-2-monitors-not-working-in-ubuntu/40659)

<div class="topic-metadata">

**Author:** [@mischmeisterm](https://discourse.processing.org/u/mischmeisterm)\
**Replies:** 1\
**Last updated:** [January 20, 2023, 3:28pm UTC](https://discourse.processing.org/t/fullscreen-p3d-span-with-2-monitors-not-working-in-ubuntu/40659 "2023-01-20T15:28:49Z")

</div>

Trying to get a proper fullscreen P2D/P3D sketch working on Ubuntu 22.04 with two monitors… fullScreen(SPAN); uses both monitors (but doesn’t hide dock and activities bar) uses the very slow default renderer fullScre…

---

## [int96:NullPointerException](https://discourse.processing.org/t/int96-nullpointerexception/40653)

<div class="topic-metadata">

**Author:** [@int96](https://discourse.processing.org/u/int96)\
**Replies:** 4\
**Last updated:** [January 20, 2023, 6:05am UTC](https://discourse.processing.org/t/int96-nullpointerexception/40653 "2023-01-20T06:05:33Z")

</div>

So here is the basic code… for the life of me I can’t see whats wrong. sketch Particle p; Particle\[\] particles = new Particle\[1\]; void setup() { size(200, 200); particles\[0\] = new Particle(); } void draw() { ba…

---

## [Slowing a rotation using millis() does not work](https://discourse.processing.org/t/slowing-a-rotation-using-millis-does-not-work/40649)

<div class="topic-metadata">

**Author:** [@mmuylle](https://discourse.processing.org/u/mmuylle)\
**Replies:** 6\
**Last updated:** [January 19, 2023, 8:24pm UTC](https://discourse.processing.org/t/slowing-a-rotation-using-millis-does-not-work/40649 "2023-01-19T20:24:09Z")

</div>

I apologise. I know this topic has been covered several times in various forms in this forum. Unfortunately, after several readings, I seem to miss the point. As a result, my timing in the sketch turns out to be wrong. W…

---

## [Movie Maker error: "Creating the QuickTime movie failed."](https://discourse.processing.org/t/movie-maker-error-creating-the-quicktime-movie-failed/40623)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 1\
**Last updated:** [January 18, 2023, 5:21pm UTC](https://discourse.processing.org/t/movie-maker-error-creating-the-quicktime-movie-failed/40623 "2023-01-18T17:21:03Z")

</div>

Hi Processing community! I am attempting to create an animation with Processing’s Movie Maker II. I am able to create the “output” folder of still images, but once I drag the “output” folder with image files into the Mo…

---

## [How can I make my bullets not follow the mouse but aim toward it?](https://discourse.processing.org/t/how-can-i-make-my-bullets-not-follow-the-mouse-but-aim-toward-it/40633)

<div class="topic-metadata">

**Author:** [@UltimateDoug](https://discourse.processing.org/u/UltimateDoug)\
**Replies:** 3\
**Last updated:** [January 18, 2023, 4:00pm UTC](https://discourse.processing.org/t/how-can-i-make-my-bullets-not-follow-the-mouse-but-aim-toward-it/40633 "2023-01-18T16:00:06Z")

</div>

Making a zombie survival game and the bullets, after they’re shot, continue to follow the mouse. The PVector “t” cant be initialized in keyReleased but it needs to only give a single value per shot. Instead it keep updat…

---

## [How to make particles fly from one word's shape to the next word? (swarm)](https://discourse.processing.org/t/how-to-make-particles-fly-from-one-words-shape-to-the-next-word-swarm/40564)

<div class="topic-metadata">

**Author:** [@lolonulu](https://discourse.processing.org/u/lolonulu)\
**Replies:** 14\
**Last updated:** [January 18, 2023, 1:36pm UTC](https://discourse.processing.org/t/how-to-make-particles-fly-from-one-words-shape-to-the-next-word-swarm/40564 "2023-01-18T13:36:34Z")

</div>

Hello, I try to move the particles from the shape of a String to the next one… I guess I should remove a part of the particles and create new ones for the new String but I don’t manage to figure out how?! Thank you ve…

---

## [Inline Shader code will not run](https://discourse.processing.org/t/inline-shader-code-will-not-run/40627)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 2\
**Last updated:** [January 18, 2023, 4:17am UTC](https://discourse.processing.org/t/inline-shader-code-will-not-run/40627 "2023-01-18T04:17:32Z")

</div>

The following Processing code using inline shaders will not run on a Mac due to this error: ERROR: 0:6: 'attribute' : syntax error: syntax error The same code using separate .glsl files in the sketch folder runs ok. T…

---

## [Need help with making a bullet that shoots towards the mouse](https://discourse.processing.org/t/need-help-with-making-a-bullet-that-shoots-towards-the-mouse/40626)

<div class="topic-metadata">

**Author:** [@UltimateDoug](https://discourse.processing.org/u/UltimateDoug)\
**Replies:** 2\
**Last updated:** [January 18, 2023, 12:26am UTC](https://discourse.processing.org/t/need-help-with-making-a-bullet-that-shoots-towards-the-mouse/40626 "2023-01-18T00:26:45Z")

</div>

I’m making a zombie survival game and I’ve come across a problem when I was making my ArrayList of bullets. The bullets show up on the screen but wont move. With some trouble shooting it looks like the variables “d” and …

---

## [Where to safe my shader so that Processing finds it?](https://discourse.processing.org/t/where-to-safe-my-shader-so-that-processing-finds-it/40616)

<div class="topic-metadata">

**Author:** [@adrinalino](https://discourse.processing.org/u/adrinalino)\
**Replies:** 10\
**Last updated:** [January 17, 2023, 2:14am UTC](https://discourse.processing.org/t/where-to-safe-my-shader-so-that-processing-finds-it/40616 "2023-01-17T02:14:54Z")

</div>

Hi every one, I hope you can help me. I’m getting into programming shaders and would like to use processing to visualise them. According to “The Book of Shaders” the following code should load it : PShader shader; vo…

---

## [Struggling to figure out solution to fix IndexOutOfBoundsException](https://discourse.processing.org/t/struggling-to-figure-out-solution-to-fix-indexoutofboundsexception/40603)

<div class="topic-metadata">

**Author:** [@Mr\_Derp\_Face](https://discourse.processing.org/u/Mr_Derp_Face)\
**Replies:** 2\
**Last updated:** [January 16, 2023, 3:04pm UTC](https://discourse.processing.org/t/struggling-to-figure-out-solution-to-fix-indexoutofboundsexception/40603 "2023-01-16T15:04:19Z")

</div>

I am working on a project where you have to shoot an enemy. Unfortunetly when the bullet hits the enemy if only one shot is currently active it will throw IndexOutOfBoundsException. I am lost on what to do the remedy thi…

---

## [The dist() function creates unexpected values](https://discourse.processing.org/t/the-dist-function-creates-unexpected-values/40577)

<div class="topic-metadata">

**Author:** [@JamOne](https://discourse.processing.org/u/JamOne)\
**Replies:** 2\
**Last updated:** [January 15, 2023, 7:43pm UTC](https://discourse.processing.org/t/the-dist-function-creates-unexpected-values/40577 "2023-01-15T19:43:04Z")

</div>

Hello, I struggle with this code. I even tried to talk to the ChatGBT but didn’t help. For some reason, “dist” creates big dips in its values and therefore bigger ellipses on the path where they should not be. See image…

---

## [Moving 2D airplanes along a curved path with nose pointing forward](https://discourse.processing.org/t/moving-2d-airplanes-along-a-curved-path-with-nose-pointing-forward/40588)

<div class="topic-metadata">

**Author:** [@hoend008](https://discourse.processing.org/u/hoend008)\
**Replies:** 2\
**Last updated:** [January 15, 2023, 11:36am UTC](https://discourse.processing.org/t/moving-2d-airplanes-along-a-curved-path-with-nose-pointing-forward/40588 "2023-01-15T11:36:57Z")

</div>

Hello all, I recently made an animation with objects moving along a curved path from A to B on a map. I now like to take things to the next level and draw a number of airplane shapes on a map and have them move along a …

---

## [PDF library is only exporting corner of image](https://discourse.processing.org/t/pdf-library-is-only-exporting-corner-of-image/40590)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 1\
**Last updated:** [January 14, 2023, 9:31pm UTC](https://discourse.processing.org/t/pdf-library-is-only-exporting-corner-of-image/40590 "2023-01-14T21:31:55Z")

</div>

Hi! My goal is to make a high resolution PDF of my processing sketch so I can print it large. When using the following PDF library I am only getting a portion of the sketch. Why is this? My sketch is size(900, 900); imp…

---

## [Recursive Tree & Conversion into 3D Space?](https://discourse.processing.org/t/recursive-tree-conversion-into-3d-space/40571)

<div class="topic-metadata">

**Author:** [@lemoney](https://discourse.processing.org/u/lemoney)\
**Replies:** 2\
**Last updated:** [January 14, 2023, 12:10pm UTC](https://discourse.processing.org/t/recursive-tree-conversion-into-3d-space/40571 "2023-01-14T12:10:34Z")

</div>

I’m studying the code below (written by S. Calderon) and we’ve been asked to turn the generated image from 2D to 3D. The code itself is quite complex and as a beginner, I’d appreciate any hints on how I can go about thi…

---

## [Identifying a tie on tictactoe](https://discourse.processing.org/t/identifying-a-tie-on-tictactoe/40574)

<div class="topic-metadata">

**Author:** [@berrae](https://discourse.processing.org/u/berrae)\
**Replies:** 2\
**Last updated:** [January 13, 2023, 7:49pm UTC](https://discourse.processing.org/t/identifying-a-tie-on-tictactoe/40574 "2023-01-13T19:49:34Z")

</div>

im wondering if theres a way to identify a tie in this tic tac toe game using the method of the rest of the game. here is my code \< Cell board; //Object int cols=3; //Number of columns int rows=3; //Number of rows i…

---

## [Passing variables in threads by ChatGPT](https://discourse.processing.org/t/passing-variables-in-threads-by-chatgpt/40379)

<div class="topic-metadata">

**Author:** [@x13420x](https://discourse.processing.org/u/x13420x)\
**Replies:** 9\
**Last updated:** [January 13, 2023, 4:28pm UTC](https://discourse.processing.org/t/passing-variables-in-threads-by-chatgpt/40379 "2023-01-13T16:28:25Z")

</div>

String\[\] array; int value; Thread thread; void setup() { // Initialize the array and value array = new String\[10\]; value = 42; // Start a new thread to save the file thread = new Thread(new Runnable() { …

---

## [Hide icon from windows start bar](https://discourse.processing.org/t/hide-icon-from-windows-start-bar/40572)

<div class="topic-metadata">

**Author:** [@Mikey83](https://discourse.processing.org/u/Mikey83)\
**Replies:** 1\
**Last updated:** [January 13, 2023, 5:28am UTC](https://discourse.processing.org/t/hide-icon-from-windows-start-bar/40572 "2023-01-13T05:28:53Z")

</div>

Hi all, is there a way to hide the icon of a sketch from the windows start bar? Ive seen it might be possible with JFrame but know nothing about that side of java, just wondering if its possible with PApplet or something…

---

## [Open file selector while programm is running?](https://discourse.processing.org/t/open-file-selector-while-programm-is-running/40512)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 5\
**Last updated:** [January 12, 2023, 11:57am UTC](https://discourse.processing.org/t/open-file-selector-while-programm-is-running/40512 "2023-01-12T11:57:06Z")

</div>

i was trying to make a programm where if i klick a button, i can select an image! but if i try it just opens the selector over and over until my pc crashes! void setup() { size(960,540); } void draw() { if(mousePre…

---

## [Rotating Maze tile pattern](https://discourse.processing.org/t/rotating-maze-tile-pattern/40531)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 6\
**Last updated:** [January 11, 2023, 6:51pm UTC](https://discourse.processing.org/t/rotating-maze-tile-pattern/40531 "2023-01-11T18:51:44Z")

</div>

Hi Processing community! I am trying to figure out how to rasterize a PImage(); by connecting the rotation of each tile to a value each pixel. So far I have figured out the rotation of the rectangle and the maze tile pa…

---

## [Grid Java Processing](https://discourse.processing.org/t/grid-java-processing/39152)

<div class="topic-metadata">

**Author:** [@ArcJAVA](https://discourse.processing.org/u/ArcJAVA)\
**Replies:** 4\
**Last updated:** [October 16, 2022, 10:03am UTC](https://discourse.processing.org/t/grid-java-processing/39152 "2022-10-16T10:03:00Z")

</div>

hi, i want to use the 0 and 1 as the color. so black and a little lighter. but I cant seem to print it in the grafic screen. p.s im not allowed to use classes. int \[\]\[\] grid = { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,…

---

## [TicTacToe code not working](https://discourse.processing.org/t/tictactoe-code-not-working/40542)

<div class="topic-metadata">

**Author:** [@berrae](https://discourse.processing.org/u/berrae)\
**Replies:** 3\
**Last updated:** [January 11, 2023, 2:15am UTC](https://discourse.processing.org/t/tictactoe-code-not-working/40542 "2023-01-11T02:15:07Z")

</div>

here is my code - this is my first time working with object and class Cell\[\]\[\] board; //object int cols=3; //number of columns int rows=3; //number of rows int player=0; //player int win=0; //used for win or draw int ga…

---

## [How could I make my player gradually rotate to the angle it's moving?](https://discourse.processing.org/t/how-could-i-make-my-player-gradually-rotate-to-the-angle-its-moving/40496)

<div class="topic-metadata">

**Author:** [@vinijoncrafts](https://discourse.processing.org/u/vinijoncrafts)\
**Replies:** 4\
**Last updated:** [January 10, 2023, 9:22am UTC](https://discourse.processing.org/t/how-could-i-make-my-player-gradually-rotate-to-the-angle-its-moving/40496 "2023-01-10T09:22:18Z")

</div>

I don’t really understand fully how vectors work, and I’m trying to implement them in my code. I am very sure that the use of vector makes a lot of stuff easier but for now I’ll rely on the help of you guys lol Vini vin…

---

## [Wanting to make the columns to have a border when I hover over them](https://discourse.processing.org/t/wanting-to-make-the-columns-to-have-a-border-when-i-hover-over-them/40487)

<div class="topic-metadata">

**Author:** [@sabisiiuuu](https://discourse.processing.org/u/sabisiiuuu)\
**Replies:** 2\
**Last updated:** [January 8, 2023, 7:52pm UTC](https://discourse.processing.org/t/wanting-to-make-the-columns-to-have-a-border-when-i-hover-over-them/40487 "2023-01-08T19:52:59Z")

</div>

Hello everyone! As far as I could see in the Mouse functions code of processing I need to first check if the mouse is over (or above since I wrote the code that way) the columns and if so, then change the stroke() to I …

---

## [Want columns to get thinner, but they get on top of each other](https://discourse.processing.org/t/want-columns-to-get-thinner-but-they-get-on-top-of-each-other/40513)

<div class="topic-metadata">

**Author:** [@sabisiiuuu](https://discourse.processing.org/u/sabisiiuuu)\
**Replies:** 2\
**Last updated:** [January 8, 2023, 5:04pm UTC](https://discourse.processing.org/t/want-columns-to-get-thinner-but-they-get-on-top-of-each-other/40513 "2023-01-08T17:04:21Z")

</div>

Hello there! So, I want the columns to get thinner if I add more rows to the table data, and also to preserve a distance between themselves of 10 units, but my columns get on top of each other if I add more than 12 rows…

---

## [Help with creating classes for my code](https://discourse.processing.org/t/help-with-creating-classes-for-my-code/40471)

<div class="topic-metadata">

**Author:** [@EB1](https://discourse.processing.org/u/EB1)\
**Replies:** 8\
**Last updated:** [January 8, 2023, 2:43pm UTC](https://discourse.processing.org/t/help-with-creating-classes-for-my-code/40471 "2023-01-08T14:43:29Z")

</div>

I have created a simple game where enemies move towards a stationary target but I am struggling to separate the code and put them into classes. I want to have 2 classes called enemy and target. I have attempted to move t…

---

## [Rotation movement](https://discourse.processing.org/t/rotation-movement/40509)

<div class="topic-metadata">

**Author:** [@ctremblay](https://discourse.processing.org/u/ctremblay)\
**Replies:** 2\
**Last updated:** [January 8, 2023, 12:08pm UTC](https://discourse.processing.org/t/rotation-movement/40509 "2023-01-08T12:08:47Z")

</div>

I’m trying to make a fun game & watched a few videos on rotation, but my rotation aint being consistant. I drew a red line where it first started moving so i could check, but now it moving backwards sideways it barely fo…

---

## [Bergen's Grid Illusion - wonky order of execution](https://discourse.processing.org/t/bergens-grid-illusion-wonky-order-of-execution/40505)

<div class="topic-metadata">

**Author:** [@JonnieNightTime](https://discourse.processing.org/u/JonnieNightTime)\
**Replies:** 2\
**Last updated:** [January 8, 2023, 12:03pm UTC](https://discourse.processing.org/t/bergens-grid-illusion-wonky-order-of-execution/40505 "2023-01-08T12:03:42Z")

</div>

hi All, I’m doing something wrong here - the grey “axles” should be behind the white ellipses, not the other way around as they are here - I’ve spent a couple of hours moving around code, but just can’t fix it - duhh! f…

---

## [How I could resizes the object for character for a game](https://discourse.processing.org/t/how-i-could-resizes-the-object-for-character-for-a-game/40502)

<div class="topic-metadata">

**Author:** [@kayiist](https://discourse.processing.org/u/kayiist)\
**Replies:** 1\
**Last updated:** [January 8, 2023, 3:32am UTC](https://discourse.processing.org/t/how-i-could-resizes-the-object-for-character-for-a-game/40502 "2023-01-08T03:32:57Z")

</div>

float x = 200; float y = 200; int\[\] pipeX, pipeY; //Declaring void setup() { size(800, 620); bg =loadImage("bg.jpg"); top\_pipes = loadImage("top.png"); bottom\_pipes = loadImage("bottom.png"); pipeX = new int…

---

## [Redraw function with color change/mouse interaction](https://discourse.processing.org/t/redraw-function-with-color-change-mouse-interaction/40479)

<div class="topic-metadata">

**Author:** [@lemoney](https://discourse.processing.org/u/lemoney)\
**Replies:** 4\
**Last updated:** [January 7, 2023, 9:59pm UTC](https://discourse.processing.org/t/redraw-function-with-color-change-mouse-interaction/40479 "2023-01-07T21:59:34Z")

</div>

Hi, I’m in a class where we adapt code to fulfill the assignments. I’m working on mouse interaction with the redraw() function in Processing. What I’m trying to do is have the leaf colours change everytime the mouse is…

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

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