# Processing

**URL:** https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=214

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

**Page:** 215

---

## [Can you help me with an issue](https://discourse.processing.org/t/can-you-help-me-with-an-issue/20430)

<div class="topic-metadata">

**Author:** [@Arsenii](https://discourse.processing.org/u/Arsenii)\
**Replies:** 1\
**Last updated:** [May 3, 2020, 1:24pm UTC](https://discourse.processing.org/t/can-you-help-me-with-an-issue/20430 "2020-05-03T13:24:27Z")

</div>

I can’t understand why triangle does not rotating. spaceShip ship; void setup() { size(640, 360); ship = new spaceShip(); } void draw() { background(0); ship.render(); //ship.turn(0.1); } void KeyPressed(…

---

## [Zoom/Pan constraints](https://discourse.processing.org/t/zoom-pan-constraints/20420)

<div class="topic-metadata">

**Author:** [@royschn](https://discourse.processing.org/u/royschn)\
**Replies:** 10\
**Last updated:** [May 3, 2020, 12:19pm UTC](https://discourse.processing.org/t/zoom-pan-constraints/20420 "2020-05-03T12:19:25Z")

</div>

hi all, I have a simple code that allows drawing in the Processing canvas. Scrolling the mouse allows you to zoom in and out while press and drag the right button moves the drawing accordingly (PAN). What I’m trying to…

---

## [Array reset help](https://discourse.processing.org/t/array-reset-help/20423)

<div class="topic-metadata">

**Author:** [@Dylan](https://discourse.processing.org/u/Dylan)\
**Replies:** 3\
**Last updated:** [May 3, 2020, 11:15am UTC](https://discourse.processing.org/t/array-reset-help/20423 "2020-05-03T11:15:56Z")

</div>

I’m trying to have the array reset all of the numbers to random numbers when I press the ‘r’ key but it’s not working int many=20; int\[\] array = new int\[many\]; void setup() { size(640, 480); } void draw() { scene()…

---

## [Need assistance reading sequential inputs from Arduino serial](https://discourse.processing.org/t/need-assistance-reading-sequential-inputs-from-arduino-serial/20368)

<div class="topic-metadata">

**Author:** [@Brandon\_Y](https://discourse.processing.org/u/Brandon_Y)\
**Replies:** 8\
**Last updated:** [May 2, 2020, 11:08pm UTC](https://discourse.processing.org/t/need-assistance-reading-sequential-inputs-from-arduino-serial/20368 "2020-05-02T23:08:21Z")

</div>

EDIT: Got it sorted, thanks everyone. My arduino program and device appears to be working correctly, sending the appropriate info out to serial. From reading through the console prints in processing, it is reading the …

---

## [Random Image Generation + Random Rotation](https://discourse.processing.org/t/random-image-generation-random-rotation/20372)

<div class="topic-metadata">

**Author:** [@GDlauren20](https://discourse.processing.org/u/GDlauren20)\
**Replies:** 4\
**Last updated:** [May 2, 2020, 7:14pm UTC](https://discourse.processing.org/t/random-image-generation-random-rotation/20372 "2020-05-02T19:14:10Z")

</div>

Hi, I have generated a bit of code whereby a random image, selected from my array, appears on screen where the user clicked. It currently is working but need the images that appear to randomly rotate (around the centre p…

---

## [Cannot export P3D on iMac](https://discourse.processing.org/t/cannot-export-p3d-on-imac/20098)

<div class="topic-metadata">

**Author:** [@jcdell](https://discourse.processing.org/u/jcdell)\
**Replies:** 1\
**Last updated:** [May 2, 2020, 5:08pm UTC](https://discourse.processing.org/t/cannot-export-p3d-on-imac/20098 "2020-05-02T17:08:30Z")

</div>

All P3D exported sketches crash with this reported Error. This includes many examples that I have saved and then tried to export. Also, every time I run P3D sketch I get the following ( warning?) in the console window,…

---

## [Processing net question](https://discourse.processing.org/t/processing-net-question/20377)

<div class="topic-metadata">

**Author:** [@emanresU](https://discourse.processing.org/u/emanresU)\
**Replies:** 1\
**Last updated:** [May 2, 2020, 4:53pm UTC](https://discourse.processing.org/t/processing-net-question/20377 "2020-05-02T16:53:50Z")

</div>

how i can conect to the server (library processing.net.\*) in the global net but no in the local net

---

## [Tracking brightest point to create line](https://discourse.processing.org/t/tracking-brightest-point-to-create-line/19918)

<div class="topic-metadata">

**Author:** [@maddyna](https://discourse.processing.org/u/maddyna)\
**Replies:** 1\
**Last updated:** [May 2, 2020, 4:48pm UTC](https://discourse.processing.org/t/tracking-brightest-point-to-create-line/19918 "2020-05-02T16:48:28Z")

</div>

After getting the brightest pixel and the coordinates I intend to draw a line tracing the subsequent brightest point as the light source moves around eg the way we create tracelines using pmouseX and mouseX is thr a w…

---

## [A better way to write this IF statement](https://discourse.processing.org/t/a-better-way-to-write-this-if-statement/20322)

<div class="topic-metadata">

**Author:** [@normalnatural](https://discourse.processing.org/u/normalnatural)\
**Replies:** 5\
**Last updated:** [May 2, 2020, 4:35pm UTC](https://discourse.processing.org/t/a-better-way-to-write-this-if-statement/20322 "2020-05-02T16:35:57Z")

</div>

Hi there, I’m very new to processing and I was wondering if there’s a better way to write this IF statement. What I’m doing is creating a drawing tool and want to confine the line to a space in the window. This statemen…

---

## [\[Solved\] Attack3 Joystick buttons to turn on LEDs on Arduino?](https://discourse.processing.org/t/solved-attack3-joystick-buttons-to-turn-on-leds-on-arduino/20170)

<div class="topic-metadata">

**Author:** [@Code7](https://discourse.processing.org/u/Code7)\
**Replies:** 10\
**Last updated:** [April 30, 2020, 10:03pm UTC](https://discourse.processing.org/t/solved-attack3-joystick-buttons-to-turn-on-leds-on-arduino/20170 "2020-04-30T22:03:49Z")

</div>

Hello, community I’m new to Processing and coding in general so please bear with me. I am trying to control 2 servos and a bunch of LEDs attached to an Arduino Nano clone using Logitech Attack3 Joystick and Processing …

---

## [Slowing down mouse](https://discourse.processing.org/t/slowing-down-mouse/20357)

<div class="topic-metadata">

**Author:** [@14mmss](https://discourse.processing.org/u/14mmss)\
**Replies:** 2\
**Last updated:** [May 2, 2020, 3:34pm UTC](https://discourse.processing.org/t/slowing-down-mouse/20357 "2020-05-02T15:34:41Z")

</div>

Hello, I wanted to make an ellipse that would follow the mouse but slowed down. Can anyone tell me why my code doesn’t work? float x, y; float speed = 7; void setup() { size(1000,1000); smooth(); frameRate(30); …

---

## [How to move the mouse by code](https://discourse.processing.org/t/how-to-move-the-mouse-by-code/20376)

<div class="topic-metadata">

**Author:** [@emanresU](https://discourse.processing.org/u/emanresU)\
**Replies:** 1\
**Last updated:** [May 2, 2020, 6:05am UTC](https://discourse.processing.org/t/how-to-move-the-mouse-by-code/20376 "2020-05-02T06:05:51Z")

</div>

how i can move the mouse by code in to the center of the display (window) like in 3d games where it uses for rotate the camera (i know inglish very well)

---

## [Question about a bug in my code](https://discourse.processing.org/t/question-about-a-bug-in-my-code/20164)

<div class="topic-metadata">

**Author:** [@Adi](https://discourse.processing.org/u/Adi)\
**Replies:** 23\
**Last updated:** [May 1, 2020, 9:19pm UTC](https://discourse.processing.org/t/question-about-a-bug-in-my-code/20164 "2020-05-01T21:19:19Z")

</div>

Hi all, I have created this code which aimes on a square which is taken from the top-left corner to the x and y values of the mouse when the mouse is pressed. Those 2 values are rectX and rectY. Two lines from the x-axi…

---

## [I want to show text in screen independently while using 3D camera](https://discourse.processing.org/t/i-want-to-show-text-in-screen-independently-while-using-3d-camera/20361)

<div class="topic-metadata">

**Author:** [@SilverPrevail](https://discourse.processing.org/u/SilverPrevail)\
**Replies:** 3\
**Last updated:** [May 1, 2020, 6:26pm UTC](https://discourse.processing.org/t/i-want-to-show-text-in-screen-independently-while-using-3d-camera/20361 "2020-05-01T18:26:33Z")

</div>

import java.awt.AWTException; import java.awt.Robot; public class Player{ public float x; public float y; public float z; public float vz; public float theta; public float phi; public float speed; } boole…

---

## [Giving elements HSB rainbow colors in a for loop](https://discourse.processing.org/t/giving-elements-hsb-rainbow-colors-in-a-for-loop/20316)

<div class="topic-metadata">

**Author:** [@Elfriede](https://discourse.processing.org/u/Elfriede)\
**Replies:** 5\
**Last updated:** [May 1, 2020, 6:24pm UTC](https://discourse.processing.org/t/giving-elements-hsb-rainbow-colors-in-a-for-loop/20316 "2020-05-01T18:24:22Z")

</div>

Hey eyeryone. So this is my first post. I’ve only started with processing. We got the task to make a grid of 2D Primitives which can be altered through changing the size() or number of elements. I figured that part ou…

---

## [GP4 Custom Slider Question; I want to annotate at slider position](https://discourse.processing.org/t/gp4-custom-slider-question-i-want-to-annotate-at-slider-position/20330)

<div class="topic-metadata">

**Author:** [@wakewatcher](https://discourse.processing.org/u/wakewatcher)\
**Replies:** 9\
**Last updated:** [May 1, 2020, 6:08pm UTC](https://discourse.processing.org/t/gp4-custom-slider-question-i-want-to-annotate-at-slider-position/20330 "2020-05-01T18:08:40Z")

</div>

I’d like to add some text above or below where the slider marker currently is sitting. I guess I could brute force it somehow using map(), getValueS and some trial and error offsets but since the slider already knows whe…

---

## [Problems with gravity simulation](https://discourse.processing.org/t/problems-with-gravity-simulation/20349)

<div class="topic-metadata">

**Author:** [@Kport1](https://discourse.processing.org/u/Kport1)\
**Replies:** 4\
**Last updated:** [May 1, 2020, 5:53pm UTC](https://discourse.processing.org/t/problems-with-gravity-simulation/20349 "2020-05-01T17:53:35Z")

</div>

ArrayList\<Body\> objects = new ArrayList\<Body\>(100); ArrayList\<Body\> destroy = new ArrayList\<Body\>(); float m1 = 0.5; float m2 = 1; float G = 0.00002; int maxDist = 1; float scale = 1; PVector mouse = new PVector(0, 0…

---

## [Making a server in draw()](https://discourse.processing.org/t/making-a-server-in-draw/20319)

<div class="topic-metadata">

**Author:** [@kikomali2517](https://discourse.processing.org/u/kikomali2517)\
**Replies:** 1\
**Last updated:** [May 1, 2020, 3:03pm UTC](https://discourse.processing.org/t/making-a-server-in-draw/20319 "2020-05-01T15:03:42Z")

</div>

I know that you can make servers in setup but I am wondering if you can make or initialize them in draw. I want to make a game that will connect me and my friends on a network. The thing is I want the user to choose if t…

---

## [G4P Library / GUI builder: Set default font for all GUI elements in one go?](https://discourse.processing.org/t/g4p-library-gui-builder-set-default-font-for-all-gui-elements-in-one-go/15658)

<div class="topic-metadata">

**Author:** [@mark\_orion](https://discourse.processing.org/u/mark_orion)\
**Replies:** 7\
**Last updated:** [May 1, 2020, 12:42pm UTC](https://discourse.processing.org/t/g4p-library-gui-builder-set-default-font-for-all-gui-elements-in-one-go/15658 "2020-05-01T12:42:37Z")

</div>

I am working on a Processing project that uses the G4P library. The GUI is build with the G4P GUI Builder tool. I love how easy it is now to create GUIs in Processing. The only problem is that I find the fonts far too sm…

---

## [Detect Server without activating it](https://discourse.processing.org/t/detect-server-without-activating-it/12193)

<div class="topic-metadata">

**Author:** [@Odermonicon](https://discourse.processing.org/u/Odermonicon)\
**Replies:** 6\
**Last updated:** [July 25, 2019, 3:04pm UTC](https://discourse.processing.org/t/detect-server-without-activating-it/12193 "2019-07-25T15:04:28Z")

</div>

I know that I can use server.active() to detect if a server is active, but I (think I) need to initialize the server first with new Server(this, port), is there a way to check if a server is active just by using the port…

---

## [Can't normalize fonts according to x-height](https://discourse.processing.org/t/cant-normalize-fonts-according-to-x-height/20324)

<div class="topic-metadata">

**Author:** [@dehyde](https://discourse.processing.org/u/dehyde)\
**Replies:** 3\
**Last updated:** [May 1, 2020, 6:34am UTC](https://discourse.processing.org/t/cant-normalize-fonts-according-to-x-height/20324 "2020-05-01T06:34:23Z")

</div>

Hi, I’m trying to create a normalized version of the same letter in multiple fonts. It doesn’t work as you can see in the image, the height is different for each font (same letter) I’m looping through all the fonts …

---

## [Move two shapes at a time with the keyboard](https://discourse.processing.org/t/move-two-shapes-at-a-time-with-the-keyboard/20203)

<div class="topic-metadata">

**Author:** [@Ear1yT](https://discourse.processing.org/u/Ear1yT)\
**Replies:** 6\
**Last updated:** [May 1, 2020, 1:22am UTC](https://discourse.processing.org/t/move-two-shapes-at-a-time-with-the-keyboard/20203 "2020-05-01T01:22:51Z")

</div>

Hi I’m trying to write a little Pong Game with a multi and a singleplayer. Almost everything works, I just can’t get the control of the two paddles in multiplayer right. I honestly don’t know what’s the problem, but as …

---

## [More an issue rather a coding question](https://discourse.processing.org/t/more-an-issue-rather-a-coding-question/19925)

<div class="topic-metadata">

**Author:** [@f42ter](https://discourse.processing.org/u/f42ter)\
**Replies:** 3\
**Last updated:** [May 1, 2020, 1:05am UTC](https://discourse.processing.org/t/more-an-issue-rather-a-coding-question/19925 "2020-05-01T01:05:27Z")

</div>

I start to play with an implementation of brainf\*ck. Works well so far, until it come to more complex bf code, like the mandelbrot.bf. Issue is, that while printig the result using the print statement sometime some prin…

---

## [Can you distinguish between the first time pressing a space bar and the second?](https://discourse.processing.org/t/can-you-distinguish-between-the-first-time-pressing-a-space-bar-and-the-second/19846)

<div class="topic-metadata">

**Author:** [@14mmss](https://discourse.processing.org/u/14mmss)\
**Replies:** 1\
**Last updated:** [April 16, 2020, 8:20pm UTC](https://discourse.processing.org/t/can-you-distinguish-between-the-first-time-pressing-a-space-bar-and-the-second/19846 "2020-04-16T20:20:12Z")

</div>

for my code, I need to use the space bar for both actions. but as one does something and the other does another, they end up clashing, is there any way to distinguish them? my code is for a reaction time experiment, and…

---

## [Can somebody help me with this question?](https://discourse.processing.org/t/can-somebody-help-me-with-this-question/20323)

<div class="topic-metadata">

**Author:** [@oliver\_humsafah](https://discourse.processing.org/u/oliver_humsafah)\
**Replies:** 1\
**Last updated:** [April 30, 2020, 8:08pm UTC](https://discourse.processing.org/t/can-somebody-help-me-with-this-question/20323 "2020-04-30T20:08:12Z")

</div>

Write a public function called HW8C which accepts an array of int(s) ( integers) anreturns an ArrayList containing those numbers in an appropriate form. Please use aloop to do the copy.

---

## [Custom class that extends PGraphics class not working](https://discourse.processing.org/t/custom-class-that-extends-pgraphics-class-not-working/20199)

<div class="topic-metadata">

**Author:** [@Ayfri](https://discourse.processing.org/u/Ayfri)\
**Replies:** 5\
**Last updated:** [April 30, 2020, 7:06pm UTC](https://discourse.processing.org/t/custom-class-that-extends-pgraphics-class-not-working/20199 "2020-04-30T19:06:09Z")

</div>

I have this custom Button class that extends PGraphics but I can’t figure it out how to make it working, the draw function just do nothing, I inspected the pixels and before sketch(this, x, y);, all pixels are equals to 0…

---

## [Contours with Bezier Vertex](https://discourse.processing.org/t/contours-with-bezier-vertex/20306)

<div class="topic-metadata">

**Author:** [@rebeccajkaye](https://discourse.processing.org/u/rebeccajkaye)\
**Replies:** 4\
**Last updated:** [April 30, 2020, 5:14pm UTC](https://discourse.processing.org/t/contours-with-bezier-vertex/20306 "2020-04-30T17:14:42Z")

</div>

Hello I was hoping somebody may be able to help me figure out what I’ve done wrong with my code. I’m just trying to create a square with a circle cut out and it’s not seeming to do what I want. This is my code - any he…

---

## [Fresnel effect in PShader not working right?](https://discourse.processing.org/t/fresnel-effect-in-pshader-not-working-right/20283)

<div class="topic-metadata">

**Author:** [@Bordin](https://discourse.processing.org/u/Bordin)\
**Replies:** 1\
**Last updated:** [April 30, 2020, 4:09pm UTC](https://discourse.processing.org/t/fresnel-effect-in-pshader-not-working-right/20283 "2020-04-30T16:09:54Z")

</div>

I’m currently trying to follow the famous Nvidia guide to water simulation, and I’m making some okay progress. My waves are oddly flat but that’s not really the issue. I got to the point where I wanted to implemented a r…

---

## [Advancing loop one frame at a time then save frame as a PDF -- doesn’t always save frame seen on screen](https://discourse.processing.org/t/advancing-loop-one-frame-at-a-time-then-save-frame-as-a-pdf-doesn-t-always-save-frame-seen-on-screen/20287)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 2\
**Last updated:** [April 30, 2020, 3:52pm UTC](https://discourse.processing.org/t/advancing-loop-one-frame-at-a-time-then-save-frame-as-a-pdf-doesn-t-always-save-frame-seen-on-screen/20287 "2020-04-30T15:52:16Z")

</div>

This is a piece of a larger sketch I have reduced down to basic elements for the question. It is currently set up to redraw one frame at a time when keyPressed. And with mousePressed to record a PDF of the frame shown …

---

## [Problem running code via HC-05 module](https://discourse.processing.org/t/problem-running-code-via-hc-05-module/20216)

<div class="topic-metadata">

**Author:** [@masterjader](https://discourse.processing.org/u/masterjader)\
**Replies:** 2\
**Last updated:** [April 30, 2020, 2:53pm UTC](https://discourse.processing.org/t/problem-running-code-via-hc-05-module/20216 "2020-04-30T14:53:38Z")

</div>

So I created a program to control a robot using 5 servos. I’m controlling the robot using a wireless PS4 controller using Game Controller Plus. Everything works fine when plugged in but I have to make this wireless so I …

[Previous page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=213)

[Next page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=215)
