# Coding Questions

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

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

**Page:** 22

---

## [Rect using wrong texture when using shader](https://discourse.processing.org/t/rect-using-wrong-texture-when-using-shader/39673)

<div class="topic-metadata">

**Author:** [@illus](https://discourse.processing.org/u/illus)\
**Replies:** 11\
**Last updated:** [November 12, 2022, 11:25am UTC](https://discourse.processing.org/t/rect-using-wrong-texture-when-using-shader/39673 "2022-11-12T11:25:34Z")

</div>

I’m using a chroma shader (to do some green screen video) but I want to use it twice so I have chroma.set("u\_tex",cam); rect(49,0,560,480); chroma.set("u\_tex",countDown); //rect(600,0,560,480); (I commented ou…

---

## [Distance Check within an angle/cone](https://discourse.processing.org/t/distance-check-within-an-angle-cone/39640)

<div class="topic-metadata">

**Author:** [@SolBreaker](https://discourse.processing.org/u/SolBreaker)\
**Replies:** 2\
**Last updated:** [November 9, 2022, 9:25pm UTC](https://discourse.processing.org/t/distance-check-within-an-angle-cone/39640 "2022-11-09T21:25:16Z")

</div>

Currently, I am attempting a raycasting technique with a line-circle interception (which is not working), and I was wondering if there is a way to limit a distance check within a cone in 2D. For reference, I am trying to…

---

## [How can i make balls spread from my mouse](https://discourse.processing.org/t/how-can-i-make-balls-spread-from-my-mouse/39644)

<div class="topic-metadata">

**Author:** [@returng](https://discourse.processing.org/u/returng)\
**Replies:** 2\
**Last updated:** [November 9, 2022, 3:03pm UTC](https://discourse.processing.org/t/how-can-i-make-balls-spread-from-my-mouse/39644 "2022-11-09T15:03:29Z")

</div>

Hello currently I have a problem on how can i make a ball spread out from my mouse (like an explosion). I can make it spread in one specific location but I want it spread while following my mouse.

---

## [How do I launch a Processing app? launch() FIXED! (use a shortcut if a program does not launch!)](https://discourse.processing.org/t/how-do-i-launch-a-processing-app-launch-fixed-use-a-shortcut-if-a-program-does-not-launch/39620)

<div class="topic-metadata">

**Author:** [@Lissie](https://discourse.processing.org/u/Lissie)\
**Replies:** 5\
**Last updated:** [November 8, 2022, 1:33pm UTC](https://discourse.processing.org/t/how-do-i-launch-a-processing-app-launch-fixed-use-a-shortcut-if-a-program-does-not-launch/39620 "2022-11-08T13:33:42Z")

</div>

how do i launch a processing app, that need contents like “data” and “lib” to open? i wanna launch a splashscreen sooo I just found out making a shortcut to an application works 100% fine, so if you have a script that n…

---

## [PImage background() call not working](https://discourse.processing.org/t/pimage-background-call-not-working/39597)

<div class="topic-metadata">

**Author:** [@playinmyblues](https://discourse.processing.org/u/playinmyblues)\
**Replies:** 1\
**Last updated:** [November 7, 2022, 4:29pm UTC](https://discourse.processing.org/t/pimage-background-call-not-working/39597 "2022-11-07T16:29:39Z")

</div>

I am working my way through Ira Greenberg’s original version of “Processing: Creative Coding and Computational Art.” On page 195 there is an example of using the PImage class for draw lines using pixels. The code is fair…

---

## [Losing mouse events on touchscreen devices](https://discourse.processing.org/t/losing-mouse-events-on-touchscreen-devices/39613)

<div class="topic-metadata">

**Author:** [@ottenm](https://discourse.processing.org/u/ottenm)\
**Replies:** 2\
**Last updated:** [November 7, 2022, 3:47pm UTC](https://discourse.processing.org/t/losing-mouse-events-on-touchscreen-devices/39613 "2022-11-07T15:47:58Z")

</div>

When I run the sketch below and press and release my actual mouse, I get mousePressed(), then tons of 'true’s until I let go, then mouseReleased(). Great! But if I do the same thing on the touchscreen, I don’t get mous…

---

## [Creating a world map of where it's nighttime or daytime](https://discourse.processing.org/t/creating-a-world-map-of-where-its-nighttime-or-daytime/39584)

<div class="topic-metadata">

**Author:** [@David1](https://discourse.processing.org/u/David1)\
**Replies:** 3\
**Last updated:** [November 4, 2022, 10:55pm UTC](https://discourse.processing.org/t/creating-a-world-map-of-where-its-nighttime-or-daytime/39584 "2022-11-04T22:55:20Z")

</div>

Hello all, I am fairly new to Processing, and I would like to create a world map of where it’s daytime and where it’s nighttime on the planet. Essentially, trying to emulate this: Day and Night World Map I have code to…

---

## [Fonts from Adobe Creative Cloud are not useable](https://discourse.processing.org/t/fonts-from-adobe-creative-cloud-are-not-useable/39582)

<div class="topic-metadata">

**Author:** [@gguidati](https://discourse.processing.org/u/gguidati)\
**Replies:** 2\
**Last updated:** [November 4, 2022, 7:43pm UTC](https://discourse.processing.org/t/fonts-from-adobe-creative-cloud-are-not-useable/39582 "2022-11-04T19:43:54Z")

</div>

Hello, I work with Windows 11, and I try to use a font, which I took from the Adobe Creative Cloud. I can use it in Powerpoint, Word, etc. Also, when I use the PFont.list() function the font appears properly. But when I…

---

## [How to generate points on a line?](https://discourse.processing.org/t/how-to-generate-points-on-a-line/39551)

<div class="topic-metadata">

**Author:** [@Havi](https://discourse.processing.org/u/Havi)\
**Replies:** 1\
**Last updated:** [November 2, 2022, 1:59pm UTC](https://discourse.processing.org/t/how-to-generate-points-on-a-line/39551 "2022-11-02T13:59:21Z")

</div>

Hi. I’m trying to make 6 dots along a line(0, random(height), width, random(height)). The dots should be evenly spaced. Can someone please let me know

---

## [Does anyone know how to draw a small firework using Processing?](https://discourse.processing.org/t/does-anyone-know-how-to-draw-a-small-firework-using-processing/32794)

<div class="topic-metadata">

**Author:** [@SantosCuccia](https://discourse.processing.org/u/SantosCuccia)\
**Replies:** 8\
**Last updated:** [November 2, 2022, 1:49pm UTC](https://discourse.processing.org/t/does-anyone-know-how-to-draw-a-small-firework-using-processing/32794 "2022-11-02T13:49:04Z")

</div>

Does anyone know how to draw a small firework using processing?

---

## [Is hardware acceleration possible within the Processing program](https://discourse.processing.org/t/is-hardware-acceleration-possible-within-the-processing-program/39531)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 8\
**Last updated:** [November 1, 2022, 11:55pm UTC](https://discourse.processing.org/t/is-hardware-acceleration-possible-within-the-processing-program/39531 "2022-11-01T23:55:21Z")

</div>

Is hardware acceleration possible within the processing program? For example, when ‘exe’ file is executed, ‘CPU’ and ‘RAM’ are used. Looking at the ‘framerate()’ function, it seems that the ‘CPU’ quota change betwe…

---

## [Creating a grid of dice representing an image](https://discourse.processing.org/t/creating-a-grid-of-dice-representing-an-image/38364)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 78\
**Last updated:** [November 1, 2022, 6:12pm UTC](https://discourse.processing.org/t/creating-a-grid-of-dice-representing-an-image/38364 "2022-11-01T18:12:04Z")

</div>

Hi, how would I go about creating a grid of random(); dice that respond to a PImage(); in 2D (like the image below) or a 3D (heightmap)?

---

## [Chromakey examples in processing](https://discourse.processing.org/t/chromakey-examples-in-processing/39539)

<div class="topic-metadata">

**Author:** [@bcabc](https://discourse.processing.org/u/bcabc)\
**Replies:** 1\
**Last updated:** [November 1, 2022, 9:18am UTC](https://discourse.processing.org/t/chromakey-examples-in-processing/39539 "2022-11-01T09:18:02Z")

</div>

is there any way to do chromakey in processing? i can’t seem to find any information about it.

---

## [Trying to get number values to show](https://discourse.processing.org/t/trying-to-get-number-values-to-show/39529)

<div class="topic-metadata">

**Author:** [@JHProcess](https://discourse.processing.org/u/JHProcess)\
**Replies:** 1\
**Last updated:** [November 1, 2022, 4:18am UTC](https://discourse.processing.org/t/trying-to-get-number-values-to-show/39529 "2022-11-01T04:18:49Z")

</div>

Hello Again! i have pushed my basic design to this point. My next question is trying to make the data values show up when the mouse has hovered over the rectangles. I attached a screenshot of the code working. Table ta…

---

## [The sketch continually fills rectangles on the window:](https://discourse.processing.org/t/the-sketch-continually-fills-rectangles-on-the-window/39511)

<div class="topic-metadata">

**Author:** [@add](https://discourse.processing.org/u/add)\
**Replies:** 3\
**Last updated:** [October 31, 2022, 9:24am UTC](https://discourse.processing.org/t/the-sketch-continually-fills-rectangles-on-the-window/39511 "2022-10-31T09:24:28Z")

</div>

hello everyone! how I can do this exercise? The rect may never leave the bounds of the window! void setup(){ size(842,480); stroke(0); frameRate(10); } void draw (){ int randomX; int randomY; int randomH; int r…

---

## [Make the rectangle move to the opposite corner](https://discourse.processing.org/t/make-the-rectangle-move-to-the-opposite-corner/39510)

<div class="topic-metadata">

**Author:** [@add](https://discourse.processing.org/u/add)\
**Replies:** 3\
**Last updated:** [October 31, 2022, 9:06am UTC](https://discourse.processing.org/t/make-the-rectangle-move-to-the-opposite-corner/39510 "2022-10-31T09:06:27Z")

</div>

hello! I need your help, please. I have to make the rectangle move to the opposite corner and after disappearing in the lower corner, it should appear again in the upper opposite corner. The condition is to use the mod…

---

## [Trying to visualize data](https://discourse.processing.org/t/trying-to-visualize-data/39471)

<div class="topic-metadata">

**Author:** [@JHProcess](https://discourse.processing.org/u/JHProcess)\
**Replies:** 34\
**Last updated:** [October 31, 2022, 7:51am UTC](https://discourse.processing.org/t/trying-to-visualize-data/39471 "2022-10-31T07:51:59Z")

</div>

Hi, so far this project I’m stuck on trying to set up my data and how to put the numbers on the plane. My goal is to understand what function I need to put in to make the data from my google sheets become points on the w…

---

## [Collision resolution of multiple particles](https://discourse.processing.org/t/collision-resolution-of-multiple-particles/39495)

<div class="topic-metadata">

**Author:** [@Divitiacus](https://discourse.processing.org/u/Divitiacus)\
**Replies:** 4\
**Last updated:** [October 31, 2022, 12:50am UTC](https://discourse.processing.org/t/collision-resolution-of-multiple-particles/39495 "2022-10-31T00:50:31Z")

</div>

I try to resolve collision in a multiple particle system and want to check, if my approach is good or not. The goal is to resolve the collisions in the right order, so that particle that meet first collide do so (and co…

---

## [Color lines for terrain/landscape generation](https://discourse.processing.org/t/color-lines-for-terrain-landscape-generation/39422)

<div class="topic-metadata">

**Author:** [@crv74](https://discourse.processing.org/u/crv74)\
**Replies:** 15\
**Last updated:** [October 31, 2022, 12:17am UTC](https://discourse.processing.org/t/color-lines-for-terrain-landscape-generation/39422 "2022-10-31T00:17:05Z")

</div>

Hi there and sorry if this has been answered before. I really looked on posts and solutions, but i am still so new to porcessing. I just signed in to ask for help. I followed this great tutorial as a starting point: (t…

---

## [How to create multiple object](https://discourse.processing.org/t/how-to-create-multiple-object/39504)

<div class="topic-metadata">

**Author:** [@tiredperson](https://discourse.processing.org/u/tiredperson)\
**Replies:** 5\
**Last updated:** [October 30, 2022, 6:01pm UTC](https://discourse.processing.org/t/how-to-create-multiple-object/39504 "2022-10-30T18:01:06Z")

</div>

I am trying to make a program that creates 10 circles and 10 squares that jiggles randomly in the canvas area my code generates 10 squares and 10 circles, however, they are extremely clustered, ( I’m sure that my usage …

---

## [Problem with 'for' loops and geometric shapes](https://discourse.processing.org/t/problem-with-for-loops-and-geometric-shapes/39387)

<div class="topic-metadata">

**Author:** [@lemoney](https://discourse.processing.org/u/lemoney)\
**Replies:** 4\
**Last updated:** [October 30, 2022, 5:53pm UTC](https://discourse.processing.org/t/problem-with-for-loops-and-geometric-shapes/39387 "2022-10-30T17:53:55Z")

</div>

Hi Everyone. I’m stuck with a homework assignment. I need to draw a geometric shape (I’ve chosen the rhodonea curve), show the use of an interative “for” loop and use a mouse command. (we have to show all the math). I c…

---

## [Calling simultaneous functions in draw()](https://discourse.processing.org/t/calling-simultaneous-functions-in-draw/39497)

<div class="topic-metadata">

**Author:** [@bcabc](https://discourse.processing.org/u/bcabc)\
**Replies:** 7\
**Last updated:** [October 30, 2022, 5:30pm UTC](https://discourse.processing.org/t/calling-simultaneous-functions-in-draw/39497 "2022-10-30T17:30:24Z")

</div>

Hi there - I’m struggling with a problem that I was hoping someone here could help with. I wrote some code - provided below - where the “a” key on the keyboard makes some rectangles and the “b” key makes some circles. …

---

## [Text Prompt and Response](https://discourse.processing.org/t/text-prompt-and-response/39452)

<div class="topic-metadata">

**Author:** [@panko](https://discourse.processing.org/u/panko)\
**Replies:** 10\
**Last updated:** [October 30, 2022, 4:17pm UTC](https://discourse.processing.org/t/text-prompt-and-response/39452 "2022-10-30T16:17:38Z")

</div>

Hi there - I’d like to create a text prompt in Processing, where a user can input a string and get a “response” - similar to how a text-based adventure would work - does anyone have an example of how something like that…

---

## [Adjusting a sample of positions by interpolation. Perfect shape and movement](https://discourse.processing.org/t/adjusting-a-sample-of-positions-by-interpolation-perfect-shape-and-movement/38978)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 10\
**Last updated:** [October 30, 2022, 4:07pm UTC](https://discourse.processing.org/t/adjusting-a-sample-of-positions-by-interpolation-perfect-shape-and-movement/38978 "2022-10-30T16:07:25Z")

</div>

Hi everyone! I’m trying to make a movement repeating himself by adapting the end with the beginning of the movement. For example I try to draw a circle or the shape " 8 " during an elapsed time. I would like to have o…

---

## [Cube texture image is upside down](https://discourse.processing.org/t/cube-texture-image-is-upside-down/39233)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 7\
**Last updated:** [October 30, 2022, 2:55pm UTC](https://discourse.processing.org/t/cube-texture-image-is-upside-down/39233 "2022-10-30T14:55:21Z")

</div>

I’m trying to place an image with text on the outside of a cube. The code below works well except for the fact that the text is upside down. How would I flip the text (img), either in PGraphics when the image is constr…

---

## [Can you resize an image and only show the new Image](https://discourse.processing.org/t/can-you-resize-an-image-and-only-show-the-new-image/39472)

<div class="topic-metadata">

**Author:** [@Kalarila](https://discourse.processing.org/u/Kalarila)\
**Replies:** 5\
**Last updated:** [October 30, 2022, 11:30am UTC](https://discourse.processing.org/t/can-you-resize-an-image-and-only-show-the-new-image/39472 "2022-10-30T11:30:36Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hi, so I have an easy question (I think). I’m trying to show an image and then resize it. Is there a way to only display the resized image and …

---

## [Display an Image for 5 Seconds Only Flashing](https://discourse.processing.org/t/display-an-image-for-5-seconds-only-flashing/39480)

<div class="topic-metadata">

**Author:** [@carlymoj](https://discourse.processing.org/u/carlymoj)\
**Replies:** 4\
**Last updated:** [October 29, 2022, 1:15pm UTC](https://discourse.processing.org/t/display-an-image-for-5-seconds-only-flashing/39480 "2022-10-29T13:15:02Z")

</div>

I’m creating a basic catcher-style game that catches balls of varying sizes and colors. I have a “game over” image that I’d like to display for 5 seconds before restarting the game. Right now, the image flashes but the g…

---

## [Memory usage increases as images are loaded. Help me](https://discourse.processing.org/t/memory-usage-increases-as-images-are-loaded-help-me/39450)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 6\
**Last updated:** [October 26, 2022, 11:01pm UTC](https://discourse.processing.org/t/memory-usage-increases-as-images-are-loaded-help-me/39450 "2022-10-26T23:01:31Z")

</div>

PImage fig\_image; long TIMER\_RE = 0; void setup(){ size(1000,1000); fig\_image = loadImage("fig\_image.jpg"); } void draw(){ if(TIMER\_RE \< millis()){ TIMER\_RE = millis()+1000; fig\_image = loadImage(…

---

## [Looking for a way to display particles as random .png images](https://discourse.processing.org/t/looking-for-a-way-to-display-particles-as-random-png-images/39435)

<div class="topic-metadata">

**Author:** [@chxtaigne](https://discourse.processing.org/u/chxtaigne)\
**Replies:** 14\
**Last updated:** [October 27, 2022, 6:43pm UTC](https://discourse.processing.org/t/looking-for-a-way-to-display-particles-as-random-png-images/39435 "2022-10-27T18:43:56Z")

</div>

Hello, I started a project with an ecosystem type code, now i’m trying to display some particles (Particle1 class) as random .png images, everytime a new particle 1 appear i want that it display as a different .png image…

---

## [Can't pass a 3D integer array into a GLSL shader](https://discourse.processing.org/t/cant-pass-a-3d-integer-array-into-a-glsl-shader/39392)

<div class="topic-metadata">

**Author:** [@Java.SourceForger](https://discourse.processing.org/u/Java.SourceForger)\
**Replies:** 9\
**Last updated:** [October 26, 2022, 11:27pm UTC](https://discourse.processing.org/t/cant-pass-a-3d-integer-array-into-a-glsl-shader/39392 "2022-10-26T23:27:27Z")

</div>

I have been working on a shader project using the Processing Java Library. I need to be able to use PShader.set() to pass a 3D array of integers into my GLSL shader. I tried all of the present set() methods that they ha…

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

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