# Coding Questions

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

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

**Page:** 18

---

## [I tried making this stack column chart interactive by making the values of the columns appear at the up left corner with pressing the mouse over the column, but it is only appearing the first row of data](https://discourse.processing.org/t/i-tried-making-this-stack-column-chart-interactive-by-making-the-values-of-the-columns-appear-at-the-up-left-corner-with-pressing-the-mouse-over-the-column-but-it-is-only-appearing-the-first-row-of-data/40480)

<div class="topic-metadata">

**Author:** [@sabisiiuuu](https://discourse.processing.org/u/sabisiiuuu)\
**Replies:** 6\
**Last updated:** [January 7, 2023, 5:53pm UTC](https://discourse.processing.org/t/i-tried-making-this-stack-column-chart-interactive-by-making-the-values-of-the-columns-appear-at-the-up-left-corner-with-pressing-the-mouse-over-the-column-but-it-is-only-appearing-the-first-row-of-data/40480 "2023-01-07T17:53:31Z")

</div>

Hello there! So, this is the code: // Import the CSV file Table data; void setup() { size(850, 600); // Increase the width to 850 background(255); data = loadTable("data.csv", "header"); // Find the maximu…

---

## [Reading a file with createReader](https://discourse.processing.org/t/reading-a-file-with-createreader/40499)

<div class="topic-metadata">

**Author:** [@pacoruiz](https://discourse.processing.org/u/pacoruiz)\
**Replies:** 1\
**Last updated:** [January 7, 2023, 5:17pm UTC](https://discourse.processing.org/t/reading-a-file-with-createreader/40499 "2023-01-07T17:17:39Z")

</div>

Hi Im trying to make a code that read data from a file. I have just copy the code from the reference page, but it doesnt work. It read an empty line after the end of the file. Don’t know why. My file has this: 3,6 4,8 …

---

## [Grid collage of random PImage](https://discourse.processing.org/t/grid-collage-of-random-pimage/40447)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 1\
**Last updated:** [January 7, 2023, 6:52am UTC](https://discourse.processing.org/t/grid-collage-of-random-pimage/40447 "2023-01-07T06:52:54Z")

</div>

Hi Processing community! I just created the following slit collage which randomly places areas of the image on the x axis. How do I make my image into a grid of random areas of the image by adding the y axis? Now: G…

---

## [Create .csv file with data in a column (table)](https://discourse.processing.org/t/create-csv-file-with-data-in-a-column-table/40493)

<div class="topic-metadata">

**Author:** [@fsdonato](https://discourse.processing.org/u/fsdonato)\
**Replies:** 1\
**Last updated:** [January 7, 2023, 6:15am UTC](https://discourse.processing.org/t/create-csv-file-with-data-in-a-column-table/40493 "2023-01-07T06:15:35Z")

</div>

I’m writing a code that receives the value of a potentiometer at all times (float val\_pot2) I created a function to record these values in a table in .csv format I have the following problem: I am not able to save a ne…

---

## [Putting code into classes](https://discourse.processing.org/t/putting-code-into-classes/40474)

<div class="topic-metadata">

**Author:** [@JB1](https://discourse.processing.org/u/JB1)\
**Replies:** 2\
**Last updated:** [January 6, 2023, 1:20pm UTC](https://discourse.processing.org/t/putting-code-into-classes/40474 "2023-01-06T13:20:52Z")

</div>

I have a working game where the enemy moves towards a stationary target in the centre of the screen, I am struggling to put this code into classes I have attempted to put the code in classes but I go horribly wrong somew…

---

## [Help with a quiz I need to create with the random()](https://discourse.processing.org/t/help-with-a-quiz-i-need-to-create-with-the-random/40409)

<div class="topic-metadata">

**Author:** [@iinnessic](https://discourse.processing.org/u/iinnessic)\
**Replies:** 17\
**Last updated:** [January 6, 2023, 12:42pm UTC](https://discourse.processing.org/t/help-with-a-quiz-i-need-to-create-with-the-random/40409 "2023-01-06T12:42:15Z")

</div>

Hello! So I’m really desperate about that homework I’ve got to do. So the task is creating a quiz with 3 images as the answer options and those images always change their place. To chose one of those answers you click a…

---

## [IllegalArgumentException: This table has no column named ' '](https://discourse.processing.org/t/illegalargumentexception-this-table-has-no-column-named/40464)

<div class="topic-metadata">

**Author:** [@sabisiiuuu](https://discourse.processing.org/u/sabisiiuuu)\
**Replies:** 3\
**Last updated:** [January 6, 2023, 12:15pm UTC](https://discourse.processing.org/t/illegalargumentexception-this-table-has-no-column-named/40464 "2023-01-06T12:15:51Z")

</div>

Hello there! So, I have the following csv table: Jahr;Insgesamt 2022;17392 2021;18037 2020;18515 2019;18351 2018;17695 2017;16745 2016;16088 2015;15083 2014;14316 2013;13241 2012;12158 2011;11147 And this is my code: …

---

## [Array comparison](https://discourse.processing.org/t/array-comparison/37207)

<div class="topic-metadata">

**Author:** [@mvb](https://discourse.processing.org/u/mvb)\
**Replies:** 4\
**Last updated:** [January 6, 2023, 11:03am UTC](https://discourse.processing.org/t/array-comparison/37207 "2023-01-06T11:03:05Z")

</div>

Hello, I have the following code, you have to get a canvas with two lines of numbers from the two arrays. The top row must contain the values of the top\_array array and the bottom row must contain the values of the bott…

---

## [Syntax incomplete statement or extra code near 'extraneous input' help](https://discourse.processing.org/t/syntax-incomplete-statement-or-extra-code-near-extraneous-input-help/40462)

<div class="topic-metadata">

**Author:** [@Ethan1](https://discourse.processing.org/u/Ethan1)\
**Replies:** 8\
**Last updated:** [January 5, 2023, 5:12pm UTC](https://discourse.processing.org/t/syntax-incomplete-statement-or-extra-code-near-extraneous-input-help/40462 "2023-01-05T17:12:10Z")

</div>

I have an assignment to do where there is a stationary target in the middle and enemies move towards the target and the user will need to click over the enemies to destroy them. I have encountered a problem in my Target …

---

## [Camera in Processing (ViewPort)](https://discourse.processing.org/t/camera-in-processing-viewport/40442)

<div class="topic-metadata">

**Author:** [@OverLord](https://discourse.processing.org/u/OverLord)\
**Replies:** 6\
**Last updated:** [January 5, 2023, 4:05pm UTC](https://discourse.processing.org/t/camera-in-processing-viewport/40442 "2023-01-05T16:05:39Z")

</div>

Hello Community Processing. I want to make a 2D game with a top view, I need the camera to follow the player, but how many times I have not tried it either “floated” or flew away.

---

## [I would like to know if there is any way to execute something with a short time without freeze the code](https://discourse.processing.org/t/i-would-like-to-know-if-there-is-any-way-to-execute-something-with-a-short-time-without-freeze-the-code/40445)

<div class="topic-metadata">

**Author:** [@Benjamin21](https://discourse.processing.org/u/Benjamin21)\
**Replies:** 5\
**Last updated:** [January 5, 2023, 9:50am UTC](https://discourse.processing.org/t/i-would-like-to-know-if-there-is-any-way-to-execute-something-with-a-short-time-without-freeze-the-code/40445 "2023-01-05T09:50:46Z")

</div>

Hello, I would like to know if there is any way to execute something after some time without using delay() because it’s freezing the code while using this delay. If anyone can help me !! Thanks :wink:

---

## [Rasterizing a rotating PShape 3d Obj](https://discourse.processing.org/t/rasterizing-a-rotating-pshape-3d-obj/40448)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 0\
**Last updated:** [January 4, 2023, 11:25pm UTC](https://discourse.processing.org/t/rasterizing-a-rotating-pshape-3d-obj/40448 "2023-01-04T23:25:56Z")

</div>

Hi Processing Community! I am running into a wall creating the rasterized layer for my rotating PShape 3d models. Here is my current code: PShape obj, obj2; PImage txtr; float theta; PGraphics canvas; void setup(){ …

---

## [Speedometer, tachometer and temperature](https://discourse.processing.org/t/speedometer-tachometer-and-temperature/39925)

<div class="topic-metadata">

**Author:** [@virtualreality](https://discourse.processing.org/u/virtualreality)\
**Replies:** 20\
**Last updated:** [January 4, 2023, 12:34pm UTC](https://discourse.processing.org/t/speedometer-tachometer-and-temperature/39925 "2023-01-04T12:34:51Z")

</div>

I only done the fuel gauge coding. but for speedometer in KM/Hr, Tachometer in RPM, Temperature degree celcius with the labeling of C and H. I need to combine speedometer into the fuel gauge in the same circle and work i…

---

## [Type mismatch: cannot convert from float to int](https://discourse.processing.org/t/type-mismatch-cannot-convert-from-float-to-int/40434)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 3\
**Last updated:** [January 4, 2023, 6:01am UTC](https://discourse.processing.org/t/type-mismatch-cannot-convert-from-float-to-int/40434 "2023-01-04T06:01:18Z")

</div>

Hi! I am receiving the following errors when trying to implement a 3d height map of triangles. “Type mismatch: cannot convert from float to int” The function “triangle()” expects parameters like: “triangle(float, floa…

---

## [PApplet, switching between multiple windows with key input](https://discourse.processing.org/t/papplet-switching-between-multiple-windows-with-key-input/40435)

<div class="topic-metadata">

**Author:** [@Mikey83](https://discourse.processing.org/u/Mikey83)\
**Replies:** 1\
**Last updated:** [January 4, 2023, 1:45am UTC](https://discourse.processing.org/t/papplet-switching-between-multiple-windows-with-key-input/40435 "2023-01-04T01:45:45Z")

</div>

Hi, im playing around with multiple windows with PApplet and just wondering if there’s any good resources available, cant seem to find any help on the things im trying to do like switch between windows being active by pr…

---

## [Dynamic prefix sum](https://discourse.processing.org/t/dynamic-prefix-sum/40421)

<div class="topic-metadata">

**Author:** [@neon124](https://discourse.processing.org/u/neon124)\
**Replies:** 2\
**Last updated:** [January 3, 2023, 10:24pm UTC](https://discourse.processing.org/t/dynamic-prefix-sum/40421 "2023-01-03T22:24:53Z")

</div>

Is there a data structure that can return the prefix sum of an array, update an element, and insert/remove entries from an array in O(log n)? “prefix sum” is the sum of all items from the first to the provided index. …

---

## [Schotter grid// rasterized image](https://discourse.processing.org/t/schotter-grid-rasterized-image/40419)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 2\
**Last updated:** [January 3, 2023, 2:20am UTC](https://discourse.processing.org/t/schotter-grid-rasterized-image/40419 "2023-01-03T02:20:05Z")

</div>

Happy New Year, Processing community! :stars: :christmas\_tree: :stars: :christmas\_tree: :stars: :stars: :stars: :fireworks: :sparkler: :confetti\_ball: :tada: :confetti\_ball: :tada: :partying\_face: :partying\_face: :tada: …

---

## [A grid of grids with variable number of cells](https://discourse.processing.org/t/a-grid-of-grids-with-variable-number-of-cells/40418)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 4\
**Last updated:** [January 3, 2023, 2:58am UTC](https://discourse.processing.org/t/a-grid-of-grids-with-variable-number-of-cells/40418 "2023-01-03T02:58:05Z")

</div>

Hello! :slightly\_smiling\_face: I’m trying to figure out where I can initialize a new random number of cells for each grid object. For example, the first grid might be divided 2 times, the second grid divided 7 times, et…

---

## [Find centre of pyramid and rotate from there, not the apex](https://discourse.processing.org/t/find-centre-of-pyramid-and-rotate-from-there-not-the-apex/40411)

<div class="topic-metadata">

**Author:** [@JonnieNightTime](https://discourse.processing.org/u/JonnieNightTime)\
**Replies:** 4\
**Last updated:** [January 2, 2023, 10:59pm UTC](https://discourse.processing.org/t/find-centre-of-pyramid-and-rotate-from-there-not-the-apex/40411 "2023-01-02T22:59:05Z")

</div>

Hi all, How can I rotate this from a centre point within the geometry rather from the vertex /apex (not sure of the correct terminology) PGraphics canvas; PVector\[\] basePts = new PVector\[3\]; void setup() { size(768,…

---

## [Is there a way to prevent Processing from opening a graphics window?](https://discourse.processing.org/t/is-there-a-way-to-prevent-processing-from-opening-a-graphics-window/40388)

<div class="topic-metadata">

**Author:** [@adrinalino](https://discourse.processing.org/u/adrinalino)\
**Replies:** 4\
**Last updated:** [January 1, 2023, 2:33pm UTC](https://discourse.processing.org/t/is-there-a-way-to-prevent-processing-from-opening-a-graphics-window/40388 "2023-01-01T14:33:19Z")

</div>

Hi there. I would like to write a program that only has text output. Is there a way to prevent processing from opening a graphics window? Thanks for your help. Cheers, Adrian.

---

## [Player movement is snappy](https://discourse.processing.org/t/player-movement-is-snappy/40331)

<div class="topic-metadata">

**Author:** [@vinijoncrafts](https://discourse.processing.org/u/vinijoncrafts)\
**Replies:** 4\
**Last updated:** [December 28, 2022, 2:41pm UTC](https://discourse.processing.org/t/player-movement-is-snappy/40331 "2022-12-28T14:41:27Z")

</div>

for example, when W A S D are pressed in quick succession and repeatedly, it sometimes lags opposite to the direction it’s going. Vini vini; void setup() { fullScreen(); vini = new Vini(); } void draw() { backgrou…

---

## [STL 3D Model exported into OBJ file](https://discourse.processing.org/t/stl-3d-model-exported-into-obj-file/40293)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 37\
**Last updated:** [December 28, 2022, 3:44am UTC](https://discourse.processing.org/t/stl-3d-model-exported-into-obj-file/40293 "2022-12-28T03:44:36Z")

</div>

Today I exported a .STL 3D model in blender to an .OBJ file. When I loaded the model into Processing.js it was black. I added lighting but it didn’t illuminate the model. Is there an alternative file to export that is be…

---

## [Pictures, pixelated, grids, flow.](https://discourse.processing.org/t/pictures-pixelated-grids-flow/40194)

<div class="topic-metadata">

**Author:** [@Jiang](https://discourse.processing.org/u/Jiang)\
**Replies:** 2\
**Last updated:** [December 28, 2022, 6:04am UTC](https://discourse.processing.org/t/pictures-pixelated-grids-flow/40194 "2022-12-28T06:04:20Z")

</div>

I have seen an interesting effect and would like to ask you what it is called and what code is used. Thank you very much.

---

## [8 directional movement in object](https://discourse.processing.org/t/8-directional-movement-in-object/40317)

<div class="topic-metadata">

**Author:** [@vinijoncrafts](https://discourse.processing.org/u/vinijoncrafts)\
**Replies:** 5\
**Last updated:** [December 27, 2022, 7:05pm UTC](https://discourse.processing.org/t/8-directional-movement-in-object/40317 "2022-12-27T19:05:03Z")

</div>

I need to make my player move in all of 8 directions using W A S D and my code makes some weird stuff when I press more than one key and I don’t know why class Vini { float x = width/2; float y = height/2; float …

---

## [A\* Algorithm Path Finding running terribly slow on Processing](https://discourse.processing.org/t/a-algorithm-path-finding-running-terribly-slow-on-processing/40314)

<div class="topic-metadata">

**Author:** [@tantrapt](https://discourse.processing.org/u/tantrapt)\
**Replies:** 2\
**Last updated:** [December 26, 2022, 8:39pm UTC](https://discourse.processing.org/t/a-algorithm-path-finding-running-terribly-slow-on-processing/40314 "2022-12-26T20:39:05Z")

</div>

Hi! I’m trying to implement a A\* Path Finding Alghoritm. It’s supposed to iterate over hundreds of Objects to see which one is closest to the target. This implementation works but it takes around 15 seconds for each obje…

---

## [PGraphics clear() is not working?](https://discourse.processing.org/t/pgraphics-clear-is-not-working/40296)

<div class="topic-metadata">

**Author:** [@FaisalKhatri](https://discourse.processing.org/u/FaisalKhatri)\
**Replies:** 7\
**Last updated:** [December 25, 2022, 8:10pm UTC](https://discourse.processing.org/t/pgraphics-clear-is-not-working/40296 "2022-12-25T20:10:38Z")

</div>

I’m trying to clear pixels in PGraphics object. It’s not working? or am I missing something? Here’s a little code for illustration. PGraphics pg; void setup() { size(600, 600); background(0); fill(255); stroke(…

---

## [loadShape() cannot find .obj file in data folder](https://discourse.processing.org/t/loadshape-cannot-find-obj-file-in-data-folder/37745)

<div class="topic-metadata">

**Author:** [@miiguell](https://discourse.processing.org/u/miiguell)\
**Replies:** 10\
**Last updated:** [December 25, 2022, 7:00pm UTC](https://discourse.processing.org/t/loadshape-cannot-find-obj-file-in-data-folder/37745 "2022-12-25T19:00:02Z")

</div>

I’m trying to import a 3D model of a space shuttle but processing is giving me a really hard time doing this for some reason. I watched examples and even opened the .OBJ file on ym computer and it renders nicely but proc…

---

## [WinRegistry not working anymore in Processing 4](https://discourse.processing.org/t/winregistry-not-working-anymore-in-processing-4/40258)

<div class="topic-metadata">

**Author:** [@Martin\_The\_Sun](https://discourse.processing.org/u/Martin_The_Sun)\
**Replies:** 9\
**Last updated:** [December 25, 2022, 7:50am UTC](https://discourse.processing.org/t/winregistry-not-working-anymore-in-processing-4/40258 "2022-12-25T07:50:09Z")

</div>

I was using java code to do file association for my software in Window platform. The class is called WinRegistry which can be commonly found online. The code worked well when I develop my software in Processing 3.5.4 but…

---

## [Truchet pattern 3D height map from blurred image](https://discourse.processing.org/t/truchet-pattern-3d-height-map-from-blurred-image/39492)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 5\
**Last updated:** [December 25, 2022, 3:33am UTC](https://discourse.processing.org/t/truchet-pattern-3d-height-map-from-blurred-image/39492 "2022-12-25T03:33:35Z")

</div>

please format code with \</\> button \* homework policy \* asking questions I would like to create a 3D heightmap of a blurred image out of the following truchet pattern grid (via “Processing: Creative Coding and Generat…

---

## [Need help in creating lasers for this spaceship! (laser beams, laser rays)](https://discourse.processing.org/t/need-help-in-creating-lasers-for-this-spaceship-laser-beams-laser-rays/40236)

<div class="topic-metadata">

**Author:** [@Envyy2020](https://discourse.processing.org/u/Envyy2020)\
**Replies:** 3\
**Last updated:** [December 23, 2022, 4:25pm UTC](https://discourse.processing.org/t/need-help-in-creating-lasers-for-this-spaceship-laser-beams-laser-rays/40236 "2022-12-23T16:25:29Z")

</div>

I need to create a spaceship that shoots lasers from the tip of the spaceship and goes up when the mouse is clicked. The lasers just need to go vertically upwards, that’s it. I HAVE SPENT HOURS trying to figure out how …

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

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