# Coding Questions

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

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

**Page:** 129

---

## [Problem with window size](https://discourse.processing.org/t/problem-with-window-size/13664)

<div class="topic-metadata">

**Author:** [@newt](https://discourse.processing.org/u/newt)\
**Replies:** 1\
**Last updated:** [August 28, 2019, 7:29am UTC](https://discourse.processing.org/t/problem-with-window-size/13664 "2019-08-28T07:29:02Z")

</div>

So I’m new in processing but I have a problem Every time I start a sketch the size il almost full screen even if I use size (500,300) or (50,30) For clarify I write Void setup(){ Size(500,300); } Void draw() { Backgro…

---

## [Rect(x,y,1,1); VS. point(x,y);](https://discourse.processing.org/t/rect-x-y-1-1-vs-point-x-y/13299)

<div class="topic-metadata">

**Author:** [@LuckSmith](https://discourse.processing.org/u/LuckSmith)\
**Replies:** 11\
**Last updated:** [August 27, 2019, 4:17pm UTC](https://discourse.processing.org/t/rect-x-y-1-1-vs-point-x-y/13299 "2019-08-27T16:17:16Z")

</div>

Can you guys try this? (try changing the size() on your computers) boolean rectOrPoint; void setup() { size(600, 300); //play with these: make those bigger if you've got a fast modern computer rectOrPoint = false;…

---

## [Text partly invisible with P3D renderer](https://discourse.processing.org/t/text-partly-invisible-with-p3d-renderer/13575)

<div class="topic-metadata">

**Author:** [@uli-b](https://discourse.processing.org/u/uli-b)\
**Replies:** 8\
**Last updated:** [August 27, 2019, 8:50am UTC](https://discourse.processing.org/t/text-partly-invisible-with-p3d-renderer/13575 "2019-08-27T08:50:28Z")

</div>

Hi, i have a problem using the P3D renderer. I am drawing some text and icons to a pgraphics object. This worked well using the Java2D renderer. To be able to introduce 3D rotation, I now switched to the P3D renderer. T…

---

## [Live update of Threshold filter](https://discourse.processing.org/t/live-update-of-threshold-filter/13635)

<div class="topic-metadata">

**Author:** [@eric](https://discourse.processing.org/u/eric)\
**Replies:** 3\
**Last updated:** [August 27, 2019, 2:37am UTC](https://discourse.processing.org/t/live-update-of-threshold-filter/13635 "2019-08-27T02:37:04Z")

</div>

I’m trying to show a photo and be able to adjust the threshold real time when holding down shift. Here’s kind of what I’ve got: PImage crossSection; float threshold = .85; void setup() { size(1008, 756); crossSect…

---

## [Trying to create a shape/load image in a class and call it in my draw (not working)](https://discourse.processing.org/t/trying-to-create-a-shape-load-image-in-a-class-and-call-it-in-my-draw-not-working/13638)

<div class="topic-metadata">

**Author:** [@bobboibob](https://discourse.processing.org/u/bobboibob)\
**Replies:** 2\
**Last updated:** [August 27, 2019, 1:27am UTC](https://discourse.processing.org/t/trying-to-create-a-shape-load-image-in-a-class-and-call-it-in-my-draw-not-working/13638 "2019-08-27T01:27:07Z")

</div>

Sorry this is a two part question but it is kind of the same question, I taught myself processing so hence I am not sure how to figure this out myself. So, I made a drawBird() function in my bird class and then in my M…

---

## [How to get mouse to click](https://discourse.processing.org/t/how-to-get-mouse-to-click/13633)

<div class="topic-metadata">

**Author:** [@kjiiller](https://discourse.processing.org/u/kjiiller)\
**Replies:** 2\
**Last updated:** [August 26, 2019, 11:35pm UTC](https://discourse.processing.org/t/how-to-get-mouse-to-click/13633 "2019-08-26T23:35:10Z")

</div>

Sorry, I’m pretty new to coding, so I don’t know much. I was wondering if it’s possible to use processing to click your mouse like an auto clicker. From what I’ve seen it’s either impossible or extrememely easy:). Thank-…

---

## [Convert color of an image from rgb to cmyk](https://discourse.processing.org/t/convert-color-of-an-image-from-rgb-to-cmyk/2922)

<div class="topic-metadata">

**Author:** [@bitCrasher](https://discourse.processing.org/u/bitCrasher)\
**Replies:** 9\
**Last updated:** [August 26, 2019, 10:24pm UTC](https://discourse.processing.org/t/convert-color-of-an-image-from-rgb-to-cmyk/2922 "2019-08-26T22:24:42Z")

</div>

hi guys i’m tryng to convert rgb values to cmyk values. i wrote this code, i think that’s right. class Cmyk { PImage img; float\[\]\[\] c, m, y, k, r1, g1, b1; Cmyk(PImage img) { this.img=img; r1 = new floa…

---

## [Spread an image on the channels of the Cmyk](https://discourse.processing.org/t/spread-an-image-on-the-channels-of-the-cmyk/13587)

<div class="topic-metadata">

**Author:** [@Grisha](https://discourse.processing.org/u/Grisha)\
**Replies:** 1\
**Last updated:** [August 26, 2019, 10:15pm UTC](https://discourse.processing.org/t/spread-an-image-on-the-channels-of-the-cmyk/13587 "2019-08-26T22:15:11Z")

</div>

I need to make 4 Pimage variables which will contain only one color of cmyk channel from source image. Could you help me, please?

---

## [Accessing class/attributes from string](https://discourse.processing.org/t/accessing-class-attributes-from-string/13583)

<div class="topic-metadata">

**Author:** [@Keif3r](https://discourse.processing.org/u/Keif3r)\
**Replies:** 3\
**Last updated:** [August 26, 2019, 8:21pm UTC](https://discourse.processing.org/t/accessing-class-attributes-from-string/13583 "2019-08-26T20:21:46Z")

</div>

Hi, What I want to do using processing 3.x with java: Basically read all variable values of a class, but accessing them indirectly by a string. e.g. class book { String title; int catalogue; String author; } ... …

---

## [Convert from .js to Processing](https://discourse.processing.org/t/convert-from-js-to-processing/13578)

<div class="topic-metadata">

**Author:** [@krocksey](https://discourse.processing.org/u/krocksey)\
**Replies:** 12\
**Last updated:** [August 25, 2019, 10:47pm UTC](https://discourse.processing.org/t/convert-from-js-to-processing/13578 "2019-08-25T22:47:33Z")

</div>

Hi! Can someone help me to convert this JavaScript to Processing. I’m not so cool for this code yet, but I really need this function for my app. Thank you stranger! Code: /\* Sample Usage: \<script type="text/javascri…

---

## [From Java to simple Desktop Application?](https://discourse.processing.org/t/from-java-to-simple-desktop-application/13582)

<div class="topic-metadata">

**Author:** [@eric](https://discourse.processing.org/u/eric)\
**Replies:** 9\
**Last updated:** [August 25, 2019, 7:11am UTC](https://discourse.processing.org/t/from-java-to-simple-desktop-application/13582 "2019-08-25T07:11:09Z")

</div>

I built a relatively simple application that measures a cross section, counts “folds” and then determines a color to white percentage. Hard to explain with little detail. My objective is to have a simple desktop app th…

---

## [Reversing the threshold filter](https://discourse.processing.org/t/reversing-the-threshold-filter/13579)

<div class="topic-metadata">

**Author:** [@eric](https://discourse.processing.org/u/eric)\
**Replies:** 2\
**Last updated:** [August 25, 2019, 4:53am UTC](https://discourse.processing.org/t/reversing-the-threshold-filter/13579 "2019-08-25T04:53:12Z")

</div>

I’ll throw in only the important parts, but for an image processing application I’m making, I want to analyze the image with the rgb components (typical picture), and then change it to black and white using the threshold…

---

## [Vehicles over 3D terrain](https://discourse.processing.org/t/vehicles-over-3d-terrain/12100)

<div class="topic-metadata">

**Author:** [@LordCacops](https://discourse.processing.org/u/LordCacops)\
**Replies:** 12\
**Last updated:** [August 24, 2019, 9:05am UTC](https://discourse.processing.org/t/vehicles-over-3d-terrain/12100 "2019-08-24T09:05:09Z")

</div>

Hello Does anyone know of a reference for creating a system of vehicles moving over a 3D rendered terrain? Thank you.

---

## [What hint(ENABLE\_OPTIMIZED\_STROKE) does?](https://discourse.processing.org/t/what-hint-enable-optimized-stroke-does/9416)

<div class="topic-metadata">

**Author:** [@vjjv](https://discourse.processing.org/u/vjjv)\
**Replies:** 12\
**Last updated:** [August 23, 2019, 9:54am UTC](https://discourse.processing.org/t/what-hint-enable-optimized-stroke-does/9416 "2019-08-23T09:54:47Z")

</div>

another simple quesiton. what Enable\_Optimized\_Stroke does?. im could not find any openGL reference. What is the openGl equivalent? Thanks!

---

## [Very low FPS problem](https://discourse.processing.org/t/very-low-fps-problem/13533)

<div class="topic-metadata">

**Author:** [@Raiben23](https://discourse.processing.org/u/Raiben23)\
**Replies:** 5\
**Last updated:** [August 22, 2019, 7:57pm UTC](https://discourse.processing.org/t/very-low-fps-problem/13533 "2019-08-22T19:57:12Z")

</div>

Hi, I’m having a problem with a code that I’m testing, that’s: Star\[\] s; Nave n; Asteroide\[\] ast; Planets\[\] plan; int numast = 5; int numplan = 2; int numstar = 500; void setup() { size(1200, 600); // frameRate(10…

---

## [\[SOLVED\] PGraphics or PImage as Uniform not working when using GLSL in Java OpenGL](https://discourse.processing.org/t/solved-pgraphics-or-pimage-as-uniform-not-working-when-using-glsl-in-java-opengl/13514)

<div class="topic-metadata">

**Author:** [@kesson](https://discourse.processing.org/u/kesson)\
**Replies:** 15\
**Last updated:** [August 22, 2019, 2:57pm UTC](https://discourse.processing.org/t/solved-pgraphics-or-pimage-as-uniform-not-working-when-using-glsl-in-java-opengl/13514 "2019-08-22T14:57:51Z")

</div>

Hello everyone, I am keeping exploring the field of shaders in Processing, even if I am facing many problems. My last problem is when I try to use a texture (for example a PGraphics of PImage) to use it as parameters f…

---

## [Trouble moving a function into a class](https://discourse.processing.org/t/trouble-moving-a-function-into-a-class/13535)

<div class="topic-metadata">

**Author:** [@ddownn](https://discourse.processing.org/u/ddownn)\
**Replies:** 2\
**Last updated:** [August 22, 2019, 2:01pm UTC](https://discourse.processing.org/t/trouble-moving-a-function-into-a-class/13535 "2019-08-22T14:01:01Z")

</div>

There is a function checkMouse() that I have moved into the Button class, and renamed it checkMouse2. For some reason I can’t figure out, when I try to call it in Button.show(), Button b2 becomes non functional, but Butt…

---

## [Rotating camera around a sketch as it draws, without effecting the drawing](https://discourse.processing.org/t/rotating-camera-around-a-sketch-as-it-draws-without-effecting-the-drawing/13500)

<div class="topic-metadata">

**Author:** [@edhull94](https://discourse.processing.org/u/edhull94)\
**Replies:** 1\
**Last updated:** [August 20, 2019, 7:49pm UTC](https://discourse.processing.org/t/rotating-camera-around-a-sketch-as-it-draws-without-effecting-the-drawing/13500 "2019-08-20T19:49:48Z")

</div>

Hi there, Wondering if someone could help me, I am new to processing and programming in general. I have created a random walker that walks a point around a 3D space. Please see code below. Now I would like to be able …

---

## [Animation with 5 balls](https://discourse.processing.org/t/animation-with-5-balls/13413)

<div class="topic-metadata">

**Author:** [@Francisco](https://discourse.processing.org/u/Francisco)\
**Replies:** 5\
**Last updated:** [August 20, 2019, 4:09pm UTC](https://discourse.processing.org/t/animation-with-5-balls/13413 "2019-08-20T16:09:55Z")

</div>

I have tried this code to iterate an array in a circular way and assign the y values to five circles. But I suspect it is not the most efficient way. Are there other ways to do it? int\[\] secuencia = {0, 5, 10, 15, 20, 2…

---

## [Saveframe() fails when exported application is emailed and run](https://discourse.processing.org/t/saveframe-fails-when-exported-application-is-emailed-and-run/13477)

<div class="topic-metadata">

**Author:** [@JPoc](https://discourse.processing.org/u/JPoc)\
**Replies:** 5\
**Last updated:** [August 20, 2019, 1:25pm UTC](https://discourse.processing.org/t/saveframe-fails-when-exported-application-is-emailed-and-run/13477 "2019-08-20T13:25:04Z")

</div>

Bit of an odd bug this one. If I export an application for OS X in 3.4 that uses saveframe() (see example code), and then run that application from my machine, the app functions correctly. If I zip that exported applicat…

---

## [Trig question, drawing an arrow head on an arc](https://discourse.processing.org/t/trig-question-drawing-an-arrow-head-on-an-arc/13354)

<div class="topic-metadata">

**Author:** [@ddownn](https://discourse.processing.org/u/ddownn)\
**Replies:** 14\
**Last updated:** [August 20, 2019, 11:57am UTC](https://discourse.processing.org/t/trig-question-drawing-an-arrow-head-on-an-arc/13354 "2019-08-20T11:57:40Z")

</div>

How can I define points t1 and t2 by their angle from point a, relative to the tangent of the arc? I would like to draw lines from point a up to line cb by specifying an angle such as 30 or 45 degrees relative to the ar…

---

## [Save int when you exit from the software](https://discourse.processing.org/t/save-int-when-you-exit-from-the-software/13484)

<div class="topic-metadata">

**Author:** [@Shadowoftime](https://discourse.processing.org/u/Shadowoftime)\
**Replies:** 4\
**Last updated:** [August 20, 2019, 10:34am UTC](https://discourse.processing.org/t/save-int-when-you-exit-from-the-software/13484 "2019-08-20T10:34:26Z")

</div>

hello, I’m a game programmer using Processing And I want the home screen to have a score table that shows the user what their highest score is. I tried all kinds of ways to save a file, but didn’t quite understand. So…

---

## [Implementing Merge Sort in Pixel Sorting](https://discourse.processing.org/t/implementing-merge-sort-in-pixel-sorting/13454)

<div class="topic-metadata">

**Author:** [@fschober](https://discourse.processing.org/u/fschober)\
**Replies:** 3\
**Last updated:** [August 19, 2019, 8:48pm UTC](https://discourse.processing.org/t/implementing-merge-sort-in-pixel-sorting/13454 "2019-08-19T20:48:42Z")

</div>

My brothers and sisters. I found you here today for I am not coming any further in thinking about this logic puzzle. I want to implement the merge sort in Shiffmans pixelsorting sketch, but I after a few days of thinki…

---

## [gl\_PointSize in Vertex Shader not working with PGL](https://discourse.processing.org/t/gl-pointsize-in-vertex-shader-not-working-with-pgl/10191)

<div class="topic-metadata">

**Author:** [@kesson](https://discourse.processing.org/u/kesson)\
**Replies:** 2\
**Last updated:** [August 19, 2019, 6:57pm UTC](https://discourse.processing.org/t/gl-pointsize-in-vertex-shader-not-working-with-pgl/10191 "2019-08-19T18:57:39Z")

</div>

Hello everyone, I am trying to use Shaders in Processing for some real time intensive rendering projects and I am writing some shaders to run it. It is a particle system, and when I try to run gl\_PointSize = 10.0; the…

---

## [Rendering a 3D shape from a File](https://discourse.processing.org/t/rendering-a-3d-shape-from-a-file/13458)

<div class="topic-metadata">

**Author:** [@GuilhermeVolker](https://discourse.processing.org/u/GuilhermeVolker)\
**Replies:** 3\
**Last updated:** [August 19, 2019, 12:51pm UTC](https://discourse.processing.org/t/rendering-a-3d-shape-from-a-file/13458 "2019-08-19T12:51:09Z")

</div>

Hello! I would like to know if there is some how to render a 3D shape on .svg or .obj, like any file from this website: https://www.tinkercad.com/things I try’d to use Pshape object but didan’t work properly PShape s;…

---

## [How do I keep the fishes in the pond?](https://discourse.processing.org/t/how-do-i-keep-the-fishes-in-the-pond/13430)

<div class="topic-metadata">

**Author:** [@Leonhard](https://discourse.processing.org/u/Leonhard)\
**Replies:** 8\
**Last updated:** [August 18, 2019, 8:45pm UTC](https://discourse.processing.org/t/how-do-i-keep-the-fishes-in-the-pond/13430 "2019-08-18T20:45:37Z")

</div>

Hi, I’m new in this “Processing World”. I’m trying to keep the fishes in the pond. I’m using this code by Nicholas Tang --\> https://www.openprocessing.org/sketch/20105/. Please help me!

---

## [Exponential Impulse not working](https://discourse.processing.org/t/exponential-impulse-not-working/13397)

<div class="topic-metadata">

**Author:** [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Replies:** 3\
**Last updated:** [August 17, 2019, 2:21pm UTC](https://discourse.processing.org/t/exponential-impulse-not-working/13397 "2019-08-17T14:21:48Z")

</div>

I’m working on this page: And I try to get Exponential Impulse to work: Exponential Impulse Great for triggering behaviours or making envelopes for music or animation, and for anything that grows fast and then slowl…

---

## [Combine different projects](https://discourse.processing.org/t/combine-different-projects/13422)

<div class="topic-metadata">

**Author:** [@joakox98](https://discourse.processing.org/u/joakox98)\
**Replies:** 2\
**Last updated:** [August 16, 2019, 8:33pm UTC](https://discourse.processing.org/t/combine-different-projects/13422 "2019-08-16T20:33:28Z")

</div>

Hello, this is my first post, and my english maybe it’s bad. But i need help I have 3 different projects that I’m working, but i have to create a menu to go to all of them, like they are levels, and also, go from one l…

---

## [Complex Boundaries](https://discourse.processing.org/t/complex-boundaries/12088)

<div class="topic-metadata">

**Author:** [@LordCacops](https://discourse.processing.org/u/LordCacops)\
**Replies:** 7\
**Last updated:** [August 16, 2019, 3:49pm UTC](https://discourse.processing.org/t/complex-boundaries/12088 "2019-08-16T15:49:59Z")

</div>

Hello! Here we have a simple system for vehicles to avoid a demarcated boundary. // The Nature of Code // Daniel Shiffman // http://natureofcode.com // Stay Within Walls // "Made-up" Steering behavior to stay within w…

---

## [Opacity with blending](https://discourse.processing.org/t/opacity-with-blending/13292)

<div class="topic-metadata">

**Author:** [@jeffthompson](https://discourse.processing.org/u/jeffthompson)\
**Replies:** 13\
**Last updated:** [August 15, 2019, 6:35pm UTC](https://discourse.processing.org/t/opacity-with-blending/13292 "2019-08-15T18:35:07Z")

</div>

I’m implementing a divide blend mode by hand to do background removal from a bunch of images. In Photoshop, I can also set the opacity of the background layer to make it a little less harsh, like this: But I can’t fig…

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

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