# Coding Questions

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

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

**Page:** 11

---

## [Shader from shadertoy : buffer issue and lots of strange differences](https://discourse.processing.org/t/shader-from-shadertoy-buffer-issue-and-lots-of-strange-differences/4276)

<div class="topic-metadata">

**Author:** [@Adrien](https://discourse.processing.org/u/Adrien)\
**Replies:** 13\
**Last updated:** [September 22, 2023, 7:11am UTC](https://discourse.processing.org/t/shader-from-shadertoy-buffer-issue-and-lots-of-strange-differences/4276 "2023-09-22T07:11:24Z")

</div>

Hi, I’m relatively new with shaders. I’m trying to port a shader from shadertoy (https://www.shadertoy.com/view/4dK3Ww) on processing 3. It’s days I’m trying, still didn’t find the/a solution, because at the moment I …

---

## [Exclude type file from selectInput()?](https://discourse.processing.org/t/exclude-type-file-from-selectinput/9719)

<div class="topic-metadata">

**Author:** [@Stanlepunk](https://discourse.processing.org/u/Stanlepunk)\
**Replies:** 17\
**Last updated:** [September 18, 2023, 5:03pm UTC](https://discourse.processing.org/t/exclude-type-file-from-selectinput/9719 "2023-09-18T17:03:25Z")

</div>

Is it possible to exclude a specific type file when we use selectInput() as seen in this image?

---

## [ArrayList\_Serializable Demo Fails](https://discourse.processing.org/t/arraylist-serializable-demo-fails/42770)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 9\
**Last updated:** [September 16, 2023, 8:21pm UTC](https://discourse.processing.org/t/arraylist-serializable-demo-fails/42770 "2023-09-16T20:21:19Z")

</div>

In trying to learn about Serializable I found this example online: https://samderlust.com/dev-blog/java/write-read-arraylist-object-file-java but am unable to get it to run without error. Similar efforts with other exam…

---

## [Mixing Pixels and Tracking pixel](https://discourse.processing.org/t/mixing-pixels-and-tracking-pixel/42757)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 0\
**Last updated:** [September 13, 2023, 4:57pm UTC](https://discourse.processing.org/t/mixing-pixels-and-tracking-pixel/42757 "2023-09-13T16:57:15Z")

</div>

Hello, I would like to track different location from my screen. The aim is to send this r, g, b data to an Arduino and modulate 8 strip Led with 8 led. In my example I have 3 ellipse, I would like to track the center …

---

## [Multiple functions under one](https://discourse.processing.org/t/multiple-functions-under-one/42698)

<div class="topic-metadata">

**Author:** [@E142](https://discourse.processing.org/u/E142)\
**Replies:** 3\
**Last updated:** [September 5, 2023, 9:52am UTC](https://discourse.processing.org/t/multiple-functions-under-one/42698 "2023-09-05T09:52:03Z")

</div>

So I’m trying to build a menu button that has three options and I want whenever an option is selected a certain program runs. So each program has a multiple functions like 3 to 4 function, so I’m finding it difficult to …

---

## [Exported processing executable doesn't start from command line](https://discourse.processing.org/t/exported-processing-executable-doesnt-start-from-command-line/42659)

<div class="topic-metadata">

**Author:** [@f.damien12](https://discourse.processing.org/u/f.damien12)\
**Replies:** 2\
**Last updated:** [August 28, 2023, 7:54pm UTC](https://discourse.processing.org/t/exported-processing-executable-doesnt-start-from-command-line/42659 "2023-08-28T19:54:44Z")

</div>

Hello I made a tool with processing I want to start from Windows command line. It works when I set the current working directory to the .exe location, and then start it by typing its name: cd C:\\path\\to\\executable\\ fi…

---

## [Renderer faster than JavaFX 2D](https://discourse.processing.org/t/renderer-faster-than-javafx-2d/42648)

<div class="topic-metadata">

**Author:** [@MrImskiy](https://discourse.processing.org/u/MrImskiy)\
**Replies:** 21\
**Last updated:** [August 26, 2023, 4:54pm UTC](https://discourse.processing.org/t/renderer-faster-than-javafx-2d/42648 "2023-08-26T16:54:55Z")

</div>

Hi everyone! Is there any renderer that is faster than JavaFX 2D? Thanks in advance, MrImskiy

---

## [Tried to remove the top bar](https://discourse.processing.org/t/tried-to-remove-the-top-bar/42647)

<div class="topic-metadata">

**Author:** [@nuhuhwy](https://discourse.processing.org/u/nuhuhwy)\
**Replies:** 2\
**Last updated:** [August 24, 2023, 8:48am UTC](https://discourse.processing.org/t/tried-to-remove-the-top-bar/42647 "2023-08-24T08:48:05Z")

</div>

I tried to remove the top bar with chatGpt but sadly i cant get it to work and i cant find anything in the forums! import processing.javafx.\*; import javax.swing.JFrame; import processing.core.PApplet; import processing…

---

## [Calculating elapsed microseconds](https://discourse.processing.org/t/calculating-elapsed-microseconds/42646)

<div class="topic-metadata">

**Author:** [@MrImskiy](https://discourse.processing.org/u/MrImskiy)\
**Replies:** 2\
**Last updated:** [August 24, 2023, 3:54am UTC](https://discourse.processing.org/t/calculating-elapsed-microseconds/42646 "2023-08-24T03:54:12Z")

</div>

Hi there! I am measuring the elapsed time of a code in a for-loop in draw(): void draw(){ for(byte i = 0; i \< 10; i++){ time\_prev = millis(); //code time\_now = millis(); deltaT = time\_now - …

---

## [Most performant and efficient way of saving data to a text file](https://discourse.processing.org/t/most-performant-and-efficient-way-of-saving-data-to-a-text-file/42605)

<div class="topic-metadata">

**Author:** [@MrImskiy](https://discourse.processing.org/u/MrImskiy)\
**Replies:** 11\
**Last updated:** [August 18, 2023, 5:32pm UTC](https://discourse.processing.org/t/most-performant-and-efficient-way-of-saving-data-to-a-text-file/42605 "2023-08-18T17:32:00Z")

</div>

Hi all! I have written this small piece of code to save data to a textfile: int time\_prev; int time\_now; int dt; StringBuilder save2Doc\_StringBuilder = new StringBuilder(); String\[\] save2Doc\_String = new String\[10000\]…

---

## [Webview in Processing](https://discourse.processing.org/t/webview-in-processing/42599)

<div class="topic-metadata">

**Author:** [@nuhuhwy](https://discourse.processing.org/u/nuhuhwy)\
**Replies:** 5\
**Last updated:** [August 17, 2023, 5:05pm UTC](https://discourse.processing.org/t/webview-in-processing/42599 "2023-08-17T17:05:03Z")

</div>

Is there a way to get a sketch to show the content of a webpage and not just the raw html code? I heard of a way to import javafx webview into the editor, but it requires recompiling the editor! Any help & advice will …

---

## [I dont know why it keep saying NullPointerException](https://discourse.processing.org/t/i-dont-know-why-it-keep-saying-nullpointerexception/30134)

<div class="topic-metadata">

**Author:** [@zang](https://discourse.processing.org/u/zang)\
**Replies:** 5\
**Last updated:** [May 19, 2021, 11:52am UTC](https://discourse.processing.org/t/i-dont-know-why-it-keep-saying-nullpointerexception/30134 "2021-05-19T11:52:00Z")

</div>

PVector A, B, C, D; float s = 100; int binary = 0; Boom c; void setup() { size(640, 640); background(255); drawrect(); c = new Boom(A,B,C,D); } void draw() { c.testmousepos(); c. getEpos () ; if (m…

---

## [Issues when rendering transparent images in 3D](https://discourse.processing.org/t/issues-when-rendering-transparent-images-in-3d/42593)

<div class="topic-metadata">

**Author:** [@Mattyjak](https://discourse.processing.org/u/Mattyjak)\
**Replies:** 1\
**Last updated:** [August 15, 2023, 3:25pm UTC](https://discourse.processing.org/t/issues-when-rendering-transparent-images-in-3d/42593 "2023-08-15T15:25:45Z")

</div>

Hello all! I’m having some issues with my program. I’m trying to render multiple 3d objects (“trees”) in this situation, but even if they’re transparent sometimes they won’t be. There’s a transparent border that displays…

---

## [PGraphics in Eclipse not displaying shapes](https://discourse.processing.org/t/pgraphics-in-eclipse-not-displaying-shapes/41894)

<div class="topic-metadata">

**Author:** [@Mattyjak](https://discourse.processing.org/u/Mattyjak)\
**Replies:** 4\
**Last updated:** [August 15, 2023, 5:00am UTC](https://discourse.processing.org/t/pgraphics-in-eclipse-not-displaying-shapes/41894 "2023-08-15T05:00:37Z")

</div>

I’m working on a project that’s using a PGraphics buffer to display to the screen. Whenever I attempt to draw a shape, PGraphics.ellipse(5, 5, 25 ,25);, or some other shape call, it won’t display at all. I’ve tried to …

---

## [QUAD\_STRIP in P3D](https://discourse.processing.org/t/quad-strip-in-p3d/42579)

<div class="topic-metadata">

**Author:** [@travis.stdenis](https://discourse.processing.org/u/travis.stdenis)\
**Replies:** 10\
**Last updated:** [August 14, 2023, 9:04pm UTC](https://discourse.processing.org/t/quad-strip-in-p3d/42579 "2023-08-14T21:04:42Z")

</div>

I am attempting to convert this ribbon shape that uses lines into using QUAD\_STRIP or even TRIANGLE\_STRIP. Here is the code snippet that generates this: noFill(); pushMatrix(); translate(midPt.x, midPt.y, midPt.z); …

---

## [I need help recreating an image (rows of circles)](https://discourse.processing.org/t/i-need-help-recreating-an-image-rows-of-circles/42577)

<div class="topic-metadata">

**Author:** [@fsociety](https://discourse.processing.org/u/fsociety)\
**Replies:** 3\
**Last updated:** [August 13, 2023, 3:47pm UTC](https://discourse.processing.org/t/i-need-help-recreating-an-image-rows-of-circles/42577 "2023-08-13T15:47:43Z")

</div>

i need to reacreate this asap

---

## [mouseX and mouseY not updating even when mouse is still in window](https://discourse.processing.org/t/mousex-and-mousey-not-updating-even-when-mouse-is-still-in-window/42588)

<div class="topic-metadata">

**Author:** [@blaster003](https://discourse.processing.org/u/blaster003)\
**Replies:** 1\
**Last updated:** [August 13, 2023, 12:32pm UTC](https://discourse.processing.org/t/mousex-and-mousey-not-updating-even-when-mouse-is-still-in-window/42588 "2023-08-13T12:32:27Z")

</div>

I’ve been making an arras.io (a top down shooter) type game, and I’m trying to make the player (which is in the centre)'s cannon(s) face the cursor, using atan2() and the rotate() function. It does work as expected, but …

---

## [Windows PC, can I use the 'Watchdog' function?](https://discourse.processing.org/t/windows-pc-can-i-use-the-watchdog-function/42580)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 7\
**Last updated:** [August 13, 2023, 12:21am UTC](https://discourse.processing.org/t/windows-pc-can-i-use-the-watchdog-function/42580 "2023-08-13T00:21:43Z")

</div>

Windows PC, can I use the ‘Watchdog’ function? hello. Nice to meet you. I want to do a ‘Watchdog’ function in ‘JAVA, Processing’. \[Watchdog means : \] An electronic timer used to detect and recover from computer malfu…

---

## [Exported Application Issues](https://discourse.processing.org/t/exported-application-issues/42209)

<div class="topic-metadata">

**Author:** [@Craig](https://discourse.processing.org/u/Craig)\
**Replies:** 5\
**Last updated:** [August 9, 2023, 2:26pm UTC](https://discourse.processing.org/t/exported-application-issues/42209 "2023-08-09T14:26:27Z")

</div>

I have written a reasonably large Processing program that acts kind of like a Photo Booth with around 50 real-time effect that save out as an image file. It works well in the Processing environment and almost well as a s…

---

## [Arc function is unpredictable!](https://discourse.processing.org/t/arc-function-is-unpredictable/42559)

<div class="topic-metadata">

**Author:** [@jeykech](https://discourse.processing.org/u/jeykech)\
**Replies:** 6\
**Last updated:** [August 6, 2023, 6:07pm UTC](https://discourse.processing.org/t/arc-function-is-unpredictable/42559 "2023-08-06T18:07:31Z")

</div>

hello all, I am writing a code with a bunch of circles and lines intersecting and I would like to draw the arcs based on the points of intersection. I isolated some parts of the code to illustrate my problem. (this is …

---

## [Very basic question on a line and a point](https://discourse.processing.org/t/very-basic-question-on-a-line-and-a-point/30123)

<div class="topic-metadata">

**Author:** [@mario60](https://discourse.processing.org/u/mario60)\
**Replies:** 5\
**Last updated:** [August 5, 2023, 11:54am UTC](https://discourse.processing.org/t/very-basic-question-on-a-line-and-a-point/30123 "2023-08-05T11:54:30Z")

</div>

Hi I am looking at https://processing.org/discourse/beta/num\_1276644884.html. Shame on me, but I miss to understand the geometry (and/or algebra) which justifies the line of code float mX = (-x1+x)\*ca + (-y1+y)\*sa;. …

---

## [Debugging my simple shader test](https://discourse.processing.org/t/debugging-my-simple-shader-test/42545)

<div class="topic-metadata">

**Author:** [@FurryNightShade](https://discourse.processing.org/u/FurryNightShade)\
**Replies:** 2\
**Last updated:** [August 3, 2023, 8:16pm UTC](https://discourse.processing.org/t/debugging-my-simple-shader-test/42545 "2023-08-03T20:16:45Z")

</div>

I’m trying my hardest to understand shaders. I know how they work theoretically, the coding seems to be difficult. While trying to write a shader I stumbled onto this problem… Processing: PImage img; PShader shader; …

---

## [SVG Export problem](https://discourse.processing.org/t/svg-export-problem/42515)

<div class="topic-metadata">

**Author:** [@appas](https://discourse.processing.org/u/appas)\
**Replies:** 5\
**Last updated:** [July 31, 2023, 4:56am UTC](https://discourse.processing.org/t/svg-export-problem/42515 "2023-07-31T04:56:07Z")

</div>

Hello, I am trying to export an SVG of an animation frame according to the instructions in the Reference, section Single Frame from an Animation (With Screen Display) , but when I press the mouse button to export, I get…

---

## [Why circle disappears at y-coordinates ~ 250](https://discourse.processing.org/t/why-circle-disappears-at-y-coordinates-250/42256)

<div class="topic-metadata">

**Author:** [@helpME0](https://discourse.processing.org/u/helpME0)\
**Replies:** 2\
**Last updated:** [July 30, 2023, 12:38pm UTC](https://discourse.processing.org/t/why-circle-disappears-at-y-coordinates-250/42256 "2023-07-30T12:38:41Z")

</div>

void setup() { size(500,500); background(0); } void draw() { loop(); float y=500+(-90\*millis()/1000+(10\*millis()\*millis()/2/1000000)); float D=25; float x = 0+15\*millis()/1000; float yc = y; float xc…

---

## [Changing font text with mouse position in Processing](https://discourse.processing.org/t/changing-font-text-with-mouse-position-in-processing/42499)

<div class="topic-metadata">

**Author:** [@juuhlbs](https://discourse.processing.org/u/juuhlbs)\
**Replies:** 6\
**Last updated:** [July 30, 2023, 12:19pm UTC](https://discourse.processing.org/t/changing-font-text-with-mouse-position-in-processing/42499 "2023-07-30T12:19:25Z")

</div>

Hello guys, I’m trying to create something relatively simple based on some studies that I made but now I’m facing an issue I don’t know enough about to solve. My idea is to change the font from light to regular and the…

---

## [Code not drawing](https://discourse.processing.org/t/code-not-drawing/42498)

<div class="topic-metadata">

**Author:** [@Rbu](https://discourse.processing.org/u/Rbu)\
**Replies:** 2\
**Last updated:** [July 26, 2023, 10:41am UTC](https://discourse.processing.org/t/code-not-drawing/42498 "2023-07-26T10:41:58Z")

</div>

So I am new and struggling i have a code that shows no errors but i not getting the desired results can some one help. PShape svg; float angle = 0; float radius = 10; float frequency = 0.1; void setup() { size(800, …

---

## [How to open window maximised?](https://discourse.processing.org/t/how-to-open-window-maximised/42450)

<div class="topic-metadata">

**Author:** [@turke1034](https://discourse.processing.org/u/turke1034)\
**Replies:** 4\
**Last updated:** [July 24, 2023, 5:19am UTC](https://discourse.processing.org/t/how-to-open-window-maximised/42450 "2023-07-24T05:19:54Z")

</div>

Hi, I want to know how to open the window maximised. Either it would open already maximised, or I could maximise it immediately after it opens. I have the following code from a stackoverflow answer: com.jogamp.newt.open…

---

## [Strategy for drawing a million objects/rectangles?](https://discourse.processing.org/t/strategy-for-drawing-a-million-objects-rectangles/42419)

<div class="topic-metadata">

**Author:** [@cch](https://discourse.processing.org/u/cch)\
**Replies:** 6\
**Last updated:** [July 17, 2023, 7:29am UTC](https://discourse.processing.org/t/strategy-for-drawing-a-million-objects-rectangles/42419 "2023-07-17T07:29:34Z")

</div>

hi all, i’m returning to Processing after a few years absence, using 4.2 IDE. i need to draw a million rectangles in 3d space, each with a new position every frame (think floating pixels) but frameRate on my mac is slowi…

---

## [Preciso de ajuda para um trabalho](https://discourse.processing.org/t/preciso-de-ajuda-para-um-trabalho/42401)

<div class="topic-metadata">

**Author:** [@vinicius](https://discourse.processing.org/u/vinicius)\
**Replies:** 1\
**Last updated:** [July 12, 2023, 5:55am UTC](https://discourse.processing.org/t/preciso-de-ajuda-para-um-trabalho/42401 "2023-07-12T05:55:01Z")

</div>

// (Lei dos cossenos e senos base) void setup() { size(800, 600); Carregar\_Logo(); windowTitle("Xing Ling® Corporation"); } void draw() { int Px, Py; background(190); print("Digite a coordenada X: "); Px…

---

## ["Destroy" instance of a class](https://discourse.processing.org/t/destroy-instance-of-a-class/42312)

<div class="topic-metadata">

**Author:** [@sterretje](https://discourse.processing.org/u/sterretje)\
**Replies:** 6\
**Last updated:** [July 8, 2023, 2:12am UTC](https://discourse.processing.org/t/destroy-instance-of-a-class/42312 "2023-07-08T02:12:23Z")

</div>

I have a class to allow the user to select a serial port using a kind-of dropdown. It lists the available ports and the user can select using the up and down arrows. An object is instantiated when the user presses ‘P’ o…

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

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