# Coding Questions

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

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

**Page:** 12

---

## [Join segments / concatenate paths](https://discourse.processing.org/t/join-segments-concatenate-paths/42355)

<div class="topic-metadata">

**Author:** [@jeykech](https://discourse.processing.org/u/jeykech)\
**Replies:** 2\
**Last updated:** [July 7, 2023, 6:58pm UTC](https://discourse.processing.org/t/join-segments-concatenate-paths/42355 "2023-07-07T18:58:03Z")

</div>

hello all, I am working on a project that is like a truchet tilling, I am using versions of a tile that are distributed in a grid and are rotates randomly to generate a certain drawing. once I have the random distributi…

---

## [Am I allowed to use PGraphics in html?](https://discourse.processing.org/t/am-i-allowed-to-use-pgraphics-in-html/42375)

<div class="topic-metadata">

**Author:** [@canslp](https://discourse.processing.org/u/canslp)\
**Replies:** 1\
**Last updated:** [July 7, 2023, 6:22pm UTC](https://discourse.processing.org/t/am-i-allowed-to-use-pgraphics-in-html/42375 "2023-07-07T18:22:19Z")

</div>

so i’m trying to embed some pdes in html and i’m running into trouble using the PGraphics buffer. it seems to be compiling and running, but it doesn’t actually draw my PGraphics canvas when i try to use image(). the cons…

---

## [Using vectors to find the line between two lines](https://discourse.processing.org/t/using-vectors-to-find-the-line-between-two-lines/41856)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 12\
**Last updated:** [July 7, 2023, 8:26am UTC](https://discourse.processing.org/t/using-vectors-to-find-the-line-between-two-lines/41856 "2023-07-07T08:26:17Z")

</div>

I can do this (see sketch) with lerp(), but it cannot be the best way. Using lerp() and starting at the desired angle, one would have to use tan(), then solve two equations before knowing what value to give lerp(). Then …

---

## [Images in Processing help?](https://discourse.processing.org/t/images-in-processing-help/42357)

<div class="topic-metadata">

**Author:** [@KiaraR](https://discourse.processing.org/u/KiaraR)\
**Replies:** 2\
**Last updated:** [July 7, 2023, 7:32am UTC](https://discourse.processing.org/t/images-in-processing-help/42357 "2023-07-07T07:32:01Z")

</div>

Basic question but I’m having trouble as a beginner: I wanted to know can you add transformations to a jpeg image in Processing? If so where do I find or upload the local file path in processing?

---

## [PGraphics weird transparency issue](https://discourse.processing.org/t/pgraphics-weird-transparency-issue/42015)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 10\
**Last updated:** [July 6, 2023, 9:50pm UTC](https://discourse.processing.org/t/pgraphics-weird-transparency-issue/42015 "2023-07-06T21:50:36Z")

</div>

Its weird, i cant explain it, so ill get straight to the point; this code makes the edge of the line look dark and weird. it uses a translucent background (not pixelated, thats fine); PGraphics pg; void setup() { s…

---

## [Call Python script](https://discourse.processing.org/t/call-python-script/42159)

<div class="topic-metadata">

**Author:** [@doni](https://discourse.processing.org/u/doni)\
**Replies:** 2\
**Last updated:** [June 12, 2023, 7:46pm UTC](https://discourse.processing.org/t/call-python-script/42159 "2023-06-12T19:46:19Z")

</div>

hi forum. is it possible to call python script from processing sketch. thank you

---

## [Need help with printing (paper, to an actual printer)](https://discourse.processing.org/t/need-help-with-printing-paper-to-an-actual-printer/42288)

<div class="topic-metadata">

**Author:** [@Illuminaria](https://discourse.processing.org/u/Illuminaria)\
**Replies:** 4\
**Last updated:** [June 25, 2023, 7:05pm UTC](https://discourse.processing.org/t/need-help-with-printing-paper-to-an-actual-printer/42288 "2023-06-25T19:05:04Z")

</div>

\<I’m an art student that got a Processing project in three stages for my Digital Art Class. No a programmer by myself. I ended up making a humble but nice autogerenating art code. What i need for the instalation is Proc…

---

## [Extend PShape (again)](https://discourse.processing.org/t/extend-pshape-again/14609)

<div class="topic-metadata">

**Author:** [@Protos](https://discourse.processing.org/u/Protos)\
**Replies:** 7\
**Last updated:** [June 24, 2023, 10:32pm UTC](https://discourse.processing.org/t/extend-pshape-again/14609 "2023-06-24T22:32:14Z")

</div>

Hi, For educational purpose I want to write a cleanly structured Pong game in processing. For the Ball I’d liked to use PShape inside a class and still have access to all the PShape methods such as setVisibility() etc.…

---

## [How do I make an array method?](https://discourse.processing.org/t/how-do-i-make-an-array-method/42286)

<div class="topic-metadata">

**Author:** [@Random\_Ghost](https://discourse.processing.org/u/Random_Ghost)\
**Replies:** 4\
**Last updated:** [June 24, 2023, 8:25pm UTC](https://discourse.processing.org/t/how-do-i-make-an-array-method/42286 "2023-06-24T20:25:27Z")

</div>

I am currently trying to make a CImage class similar to the PImage class. But I want to have a method for accessing pixel values from the image array in the form img.pixels\[y\]. How do I set up the method that way? Here…

---

## [How to make a method for easy text (alphabet, number) input](https://discourse.processing.org/t/how-to-make-a-method-for-easy-text-alphabet-number-input/42261)

<div class="topic-metadata">

**Author:** [@Hyunwoo](https://discourse.processing.org/u/Hyunwoo)\
**Replies:** 8\
**Last updated:** [June 23, 2023, 7:54am UTC](https://discourse.processing.org/t/how-to-make-a-method-for-easy-text-alphabet-number-input/42261 "2023-06-23T07:54:16Z")

</div>

Hello, I am trying to make a text window and edit the coding so that numbers and alphabets (capital letters only, automatic conversion in case of lower case letters) can be entered in the text window. I am trying to mod…

---

## [Pixel array manipulation in HSB color mode](https://discourse.processing.org/t/pixel-array-manipulation-in-hsb-color-mode/42227)

<div class="topic-metadata">

**Author:** [@LuisGranados](https://discourse.processing.org/u/LuisGranados)\
**Replies:** 3\
**Last updated:** [June 19, 2023, 5:48pm UTC](https://discourse.processing.org/t/pixel-array-manipulation-in-hsb-color-mode/42227 "2023-06-19T17:48:17Z")

</div>

I’ve made a sketch that gradually reveals a picture by starting with all black, then gradually increasing the red value of each pixel up to the desired level, then doing the same for green, then blue (or any other order …

---

## [Approximate equality for Rosetta](https://discourse.processing.org/t/approximate-equality-for-rosetta/42196)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 15\
**Last updated:** [June 17, 2023, 7:54pm UTC](https://discourse.processing.org/t/approximate-equality-for-rosetta/42196 "2023-06-17T19:54:47Z")

</div>

I noticed that Processing is missing from https://rosettacode.org/wiki/Approximate\_equality. Sure this can be improved, but here is a start… I have used ‘big’ not in a vain attempt to avoid floating point errors, but t…

---

## [Nature of code - Autonomous agents exercise 6.2](https://discourse.processing.org/t/nature-of-code-autonomous-agents-exercise-6-2/42233)

<div class="topic-metadata">

**Author:** [@alex119](https://discourse.processing.org/u/alex119)\
**Replies:** 0\
**Last updated:** [June 17, 2023, 9:43am UTC](https://discourse.processing.org/t/nature-of-code-autonomous-agents-exercise-6-2/42233 "2023-06-17T09:43:49Z")

</div>

Hello, I am trying to do the exercise 6.2 from The Nature of Code Autonomous Agents chapter. I did something like this but is not working: I looked on the github repository for this exercise, but it doesn’t seem…

---

## [Objekte ausschneiden (transparent PShape)](https://discourse.processing.org/t/objekte-ausschneiden-transparent-pshape/41968)

<div class="topic-metadata">

**Author:** [@boolan\_youport](https://discourse.processing.org/u/boolan_youport)\
**Replies:** 6\
**Last updated:** [June 15, 2023, 1:37pm UTC](https://discourse.processing.org/t/objekte-ausschneiden-transparent-pshape/41968 "2023-06-15T13:37:50Z")

</div>

Hallo meine sehr geehrten Herren/innen! Ich hoffe Sie hatten einen angenehmen Tag… doch wie wir alle wissen soll man den Tag nicht vor dem Abend loben. Deswegen wollte ich fragen, ob jemand weiß, wie man Objekte voneinan…

---

## [Accessing the contextual PGraphics explicitly when using beginRecord()](https://discourse.processing.org/t/accessing-the-contextual-pgraphics-explicitly-when-using-beginrecord/42189)

<div class="topic-metadata">

**Author:** [@andrewcooke](https://discourse.processing.org/u/andrewcooke)\
**Replies:** 3\
**Last updated:** [June 11, 2023, 7:34pm UTC](https://discourse.processing.org/t/accessing-the-contextual-pgraphics-explicitly-when-using-beginrecord/42189 "2023-06-11T19:34:07Z")

</div>

I am passing this.g to some separate Java code, and things are working just fine with the data displayed to the screen, but when I try to copy to PDF using beginRecord() and endRecord() I don’t see any of the output that…

---

## [Hanging by a thread](https://discourse.processing.org/t/hanging-by-a-thread/42135)

<div class="topic-metadata">

**Author:** [@vinijoncrafts](https://discourse.processing.org/u/vinijoncrafts)\
**Replies:** 3\
**Last updated:** [June 5, 2023, 7:28pm UTC](https://discourse.processing.org/t/hanging-by-a-thread/42135 "2023-06-05T19:28:03Z")

</div>

I want to click an object, then a thread appears and the object starts to fall until the thread reaches it’s maximum length, then it just hangs in place, like if you were holding an unraveled yoyo then released it. Thank…

---

## [Text on a free line (SVG)](https://discourse.processing.org/t/text-on-a-free-line-svg/40718)

<div class="topic-metadata">

**Author:** [@humus](https://discourse.processing.org/u/humus)\
**Replies:** 14\
**Last updated:** [June 11, 2023, 1:51am UTC](https://discourse.processing.org/t/text-on-a-free-line-svg/40718 "2023-06-11T01:51:20Z")

</div>

Hi, I am almost a newbie on Processing. I found this tutorial where it is also explained how to draw a text over a circle: Strings and Drawing Text / Processing.org . My questions are: is it possible to draw a text …

---

## [Translate camera moving](https://discourse.processing.org/t/translate-camera-moving/42089)

<div class="topic-metadata">

**Author:** [@ctremblay](https://discourse.processing.org/u/ctremblay)\
**Replies:** 3\
**Last updated:** [June 7, 2023, 10:24am UTC](https://discourse.processing.org/t/translate-camera-moving/42089 "2023-06-07T10:24:49Z")

</div>

I’m trying to make a settlement building camera scroll game, after I scroll to the side a few it won’t stop going sideways. here my code: sketch int s = 25; boolean buildBase = false; ArrayList\<Ground\> ground = new Ar…

---

## [Changing the ellipses size with the movement of the mouse (scale a shape)](https://discourse.processing.org/t/changing-the-ellipses-size-with-the-movement-of-the-mouse-scale-a-shape/42139)

<div class="topic-metadata">

**Author:** [@Bots](https://discourse.processing.org/u/Bots)\
**Replies:** 23\
**Last updated:** [June 5, 2023, 8:54pm UTC](https://discourse.processing.org/t/changing-the-ellipses-size-with-the-movement-of-the-mouse-scale-a-shape/42139 "2023-06-05T20:54:51Z")

</div>

In the following code , I am trying to increase and decrease the size of the ellipses as my mouse moves from left to right on the canvas, I would appreciate any help int logoSize = 250; void setup(){ size(500,500); } …

---

## [I am trying to make 3d platform game](https://discourse.processing.org/t/i-am-trying-to-make-3d-platform-game/42128)

<div class="topic-metadata">

**Author:** [@marslanaras](https://discourse.processing.org/u/marslanaras)\
**Replies:** 1\
**Last updated:** [June 5, 2023, 11:30am UTC](https://discourse.processing.org/t/i-am-trying-to-make-3d-platform-game/42128 "2023-06-05T11:30:45Z")

</div>

i have a project in Processing. i am trying to create basic platform game but i could not do it. Can someone help? In this code, I am trying to create a player and this player should go left and right and can jump with s…

---

## [Object walk with trail (footprints)](https://discourse.processing.org/t/object-walk-with-trail-footprints/42059)

<div class="topic-metadata">

**Author:** [@kenkt](https://discourse.processing.org/u/kenkt)\
**Replies:** 16\
**Last updated:** [May 30, 2023, 8:51pm UTC](https://discourse.processing.org/t/object-walk-with-trail-footprints/42059 "2023-05-30T20:51:00Z")

</div>

Can I combine object with trail and object with no trail?

---

## [Creating PGraphics2D/PGraphics3D without PApplet](https://discourse.processing.org/t/creating-pgraphics2d-pgraphics3d-without-papplet/42072)

<div class="topic-metadata">

**Author:** [@DavidGR74](https://discourse.processing.org/u/DavidGR74)\
**Replies:** 6\
**Last updated:** [May 27, 2023, 9:30am UTC](https://discourse.processing.org/t/creating-pgraphics2d-pgraphics3d-without-papplet/42072 "2023-05-27T09:30:53Z")

</div>

Hello, I am trying to use Processing as a rendering engine outside the PApplet context. The following test code works fine: public static void main(String\[\] args) { PGraphicsJava2D pg=new PGraphicsJava2D(); pg.s…

---

## [First-person camera (3D)](https://discourse.processing.org/t/first-person-camera-3d/42082)

<div class="topic-metadata">

**Author:** [@09husky](https://discourse.processing.org/u/09husky)\
**Replies:** 3\
**Last updated:** [May 27, 2023, 12:08am UTC](https://discourse.processing.org/t/first-person-camera-3d/42082 "2023-05-27T00:08:28Z")

</div>

My first-person camera code is having the following problems: changing the \[starting\] position of the camera makes the reference sphere disappear, replaced by a white screen; when playing around with the commented-out “b…

---

## [Climate temperature and rain API](https://discourse.processing.org/t/climate-temperature-and-rain-api/42026)

<div class="topic-metadata">

**Author:** [@isabela](https://discourse.processing.org/u/isabela)\
**Replies:** 5\
**Last updated:** [May 26, 2023, 5:25pm UTC](https://discourse.processing.org/t/climate-temperature-and-rain-api/42026 "2023-05-26T17:25:29Z")

</div>

Hello! I am looking for a simple API for weather forecasts, any suggestions? (also, I am a beginner!) Thanks, Isabela

---

## [Error moving object (using quad())](https://discourse.processing.org/t/error-moving-object-using-quad/42067)

<div class="topic-metadata">

**Author:** [@kenkt](https://discourse.processing.org/u/kenkt)\
**Replies:** 15\
**Last updated:** [May 26, 2023, 2:42pm UTC](https://discourse.processing.org/t/error-moving-object-using-quad/42067 "2023-05-26T14:42:39Z")

</div>

I want this object moving by mouse x and mouse y, but this code error. anybody, can help me? That’s my code: void setup() { size (700,700); } void draw() { background(255); quad(mouseX+1,mouseY-5,mouseX+75,mouseY+…

---

## [Adding background when outputting PDF in Processing 4 JAVA](https://discourse.processing.org/t/adding-background-when-outputting-pdf-in-processing-4-java/42063)

<div class="topic-metadata">

**Author:** [@cans](https://discourse.processing.org/u/cans)\
**Replies:** 1\
**Last updated:** [May 25, 2023, 1:31am UTC](https://discourse.processing.org/t/adding-background-when-outputting-pdf-in-processing-4-java/42063 "2023-05-25T01:31:08Z")

</div>

With Processing 4, I can save my data in PDF format. But it doesn’t happen when I try to add an image behind the PDF output. I have to use beginRecord() function because I need to record data continuously. public void s…

---

## [Which instance actually executes beginDraw() and endDraw()?](https://discourse.processing.org/t/which-instance-actually-executes-begindraw-and-enddraw/42057)

<div class="topic-metadata">

**Author:** [@vjwada](https://discourse.processing.org/u/vjwada)\
**Replies:** 4\
**Last updated:** [May 24, 2023, 9:57am UTC](https://discourse.processing.org/t/which-instance-actually-executes-begindraw-and-enddraw/42057 "2023-05-24T09:57:56Z")

</div>

I want to have two PGraphics instances and create an image for each separately. I wanted to prevent the creation of two different images due to changes in the argument contents during a long draw() execution, so I appli…

---

## [Blank PDF output for one particular sketch - checking before submitting a bug report](https://discourse.processing.org/t/blank-pdf-output-for-one-particular-sketch-checking-before-submitting-a-bug-report/42053)

<div class="topic-metadata">

**Author:** [@andrewcooke](https://discourse.processing.org/u/andrewcooke)\
**Replies:** 7\
**Last updated:** [May 23, 2023, 11:45pm UTC](https://discourse.processing.org/t/blank-pdf-output-for-one-particular-sketch-checking-before-submitting-a-bug-report/42053 "2023-05-23T23:45:14Z")

</div>

Hi, I’ve only been using processing (v4) for a short time, but am having a lot of fun generating various images. These are all based on a similar structure (I tend to develop the code incrementally, saving each step as…

---

## [\[JAVA\] CRC16 calculation is not working properly](https://discourse.processing.org/t/java-crc16-calculation-is-not-working-properly/42036)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 1\
**Last updated:** [May 20, 2023, 10:54am UTC](https://discourse.processing.org/t/java-crc16-calculation-is-not-working-properly/42036 "2023-05-20T10:54:21Z")

</div>

\[JAVA\] CRC16 calculation is not working properly. ref-url link-1 : Modbus CRC16 ref-url link-2 : 내 보조 기억 장치!: Java CRC16 Modbus CRC16Utils crcs; CRC16 crc16s; void setup(){ byte\[\] b = {0x7E, 0x01, 0x07}; int\[…

---

## [I have a project where I have to make an interactive graphics program](https://discourse.processing.org/t/i-have-a-project-where-i-have-to-make-an-interactive-graphics-program/42011)

<div class="topic-metadata">

**Author:** [@Deezer242](https://discourse.processing.org/u/Deezer242)\
**Replies:** 6\
**Last updated:** [May 19, 2023, 10:18am UTC](https://discourse.processing.org/t/i-have-a-project-where-i-have-to-make-an-interactive-graphics-program/42011 "2023-05-19T10:18:57Z")

</div>

I am trying to create shapes that can be placed with key binds and then saved in an ArrayList. The hardest thing I’m having trouble with right now is how to edit the shapes’ size and location after I have placed them. I …

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

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