# Coding Questions

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

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

**Page:** 165

---

## [Amazing spiral! Help?](https://discourse.processing.org/t/amazing-spiral-help/5570)

<div class="topic-metadata">

**Author:** [@Msandoval](https://discourse.processing.org/u/Msandoval)\
**Replies:** 1\
**Last updated:** [November 16, 2018, 1:01am UTC](https://discourse.processing.org/t/amazing-spiral-help/5570 "2018-11-16T01:01:48Z")

</div>

float m = 0; void setup(){ fullScreen(P3D); } void draw(){ background(250); rotateX(frameCount \* 0.01); translate(400,500); for(float m = 0; m \< 5; m++){ pushMatrix(); for(float i = 0; i \< 80; i++){ translate(…

---

## [Changing video speed smoothly](https://discourse.processing.org/t/changing-video-speed-smoothly/5568)

<div class="topic-metadata">

**Author:** [@trpnnr](https://discourse.processing.org/u/trpnnr)\
**Replies:** 4\
**Last updated:** [November 15, 2018, 9:57pm UTC](https://discourse.processing.org/t/changing-video-speed-smoothly/5568 "2018-11-15T21:57:53Z")

</div>

Hello, I am wondering if it may be possible to change the speed of a video file dynamically without the result having a choppy appearance - ie to speed up to or slow down smoothly to a specified rate.

---

## [Random Numbers Generator](https://discourse.processing.org/t/random-numbers-generator/5563)

<div class="topic-metadata">

**Author:** [@SpeedKillerX](https://discourse.processing.org/u/SpeedKillerX)\
**Replies:** 3\
**Last updated:** [November 15, 2018, 8:31pm UTC](https://discourse.processing.org/t/random-numbers-generator/5563 "2018-11-15T20:31:02Z")

</div>

I am making a random number generator using the code: void setup(){ size(600,600); textSize(40); } void draw(){ background(0); text(random(20),100,200); frameRate(1); } But I want the numbers to stop when I cli…

---

## [Hello, I am trying to make the balls go up continuously when holding a key 1,2,3](https://discourse.processing.org/t/hello-i-am-trying-to-make-the-balls-go-up-continuously-when-holding-a-key-1-2-3/5557)

<div class="topic-metadata">

**Author:** [@alexism2022](https://discourse.processing.org/u/alexism2022)\
**Replies:** 1\
**Last updated:** [November 15, 2018, 6:56pm UTC](https://discourse.processing.org/t/hello-i-am-trying-to-make-the-balls-go-up-continuously-when-holding-a-key-1-2-3/5557 "2018-11-15T18:56:32Z")

</div>

Hello, this is my code. I am currently trying to do what is said in this picture. I basically have 3 holes and want to make balls pop out of hole 1 when pressing 1, etc… So when you hold 1 on the keyboard, balls will…

---

## [Getting current unix time](https://discourse.processing.org/t/getting-current-unix-time/5545)

<div class="topic-metadata">

**Author:** [@JustACoder](https://discourse.processing.org/u/JustACoder)\
**Replies:** 2\
**Last updated:** [November 15, 2018, 9:50am UTC](https://discourse.processing.org/t/getting-current-unix-time/5545 "2018-11-15T09:50:23Z")

</div>

Okay I know that you can use millis() to get the time since your program started but how can I get the exact unix time?

---

## [How to access actual vertex coordinates for transformed PShape in a Group](https://discourse.processing.org/t/how-to-access-actual-vertex-coordinates-for-transformed-pshape-in-a-group/5520)

<div class="topic-metadata">

**Author:** [@ddownn](https://discourse.processing.org/u/ddownn)\
**Replies:** 4\
**Last updated:** [November 15, 2018, 9:11am UTC](https://discourse.processing.org/t/how-to-access-actual-vertex-coordinates-for-transformed-pshape-in-a-group/5520 "2018-11-15T09:11:30Z")

</div>

I’ve got this PShape Group composed of four sided polygons which have been arranged in a circle and I’m trying to access their coordinates so I can check if the mouse is over each one individually. The problem is that ea…

---

## [I'm getting a NullPointerException](https://discourse.processing.org/t/im-getting-a-nullpointerexception/5529)

<div class="topic-metadata">

**Author:** [@Str1XHyper](https://discourse.processing.org/u/Str1XHyper)\
**Replies:** 3\
**Last updated:** [November 15, 2018, 8:59am UTC](https://discourse.processing.org/t/im-getting-a-nullpointerexception/5529 "2018-11-15T08:59:41Z")

</div>

Can someone help me fix this problem. when I run this code I get a NullPointerException at rockets\[i\].update(), and even if I comment that out I get the same error but on rockets\[i\].display() and I don’t know why I have …

---

## [lerpColor triggered by event](https://discourse.processing.org/t/lerpcolor-triggered-by-event/5541)

<div class="topic-metadata">

**Author:** [@eduzal](https://discourse.processing.org/u/eduzal)\
**Replies:** 3\
**Last updated:** [November 14, 2018, 10:49pm UTC](https://discourse.processing.org/t/lerpcolor-triggered-by-event/5541 "2018-11-14T22:49:59Z")

</div>

hello i’m having some trouble to smoothly change a color from a triggered event, initially mousePressed, then i will move to a timer. I’m loading a .svg file, adding each child in a separate custom object stored in an …

---

## [Initial orientation needed on 3d models](https://discourse.processing.org/t/initial-orientation-needed-on-3d-models/5530)

<div class="topic-metadata">

**Author:** [@wrcstewart](https://discourse.processing.org/u/wrcstewart)\
**Replies:** 2\
**Last updated:** [November 14, 2018, 5:37pm UTC](https://discourse.processing.org/t/initial-orientation-needed-on-3d-models/5530 "2018-11-14T17:37:35Z")

</div>

I wonder if someone could tell me how I access the underlying 3d model. For example I can see from the doc how to import a \*.OBJ file - but then how could I for example edit it? Or, how can i set up a structure with a li…

---

## [dataPath() problem under Mac OS X](https://discourse.processing.org/t/datapath-problem-under-mac-os-x/5486)

<div class="topic-metadata">

**Author:** [@dtmr](https://discourse.processing.org/u/dtmr)\
**Replies:** 4\
**Last updated:** [November 14, 2018, 9:49am UTC](https://discourse.processing.org/t/datapath-problem-under-mac-os-x/5486 "2018-11-14T09:49:37Z")

</div>

A user of my app has reported that it fails to save to dataPath(“settings.xml”) when it is still in the download folder, due to permissions. Apparently dataPath() points to an odd directory. Ideas? App saves settings t…

---

## [Can u help me with this interesting game?](https://discourse.processing.org/t/can-u-help-me-with-this-interesting-game/5519)

<div class="topic-metadata">

**Author:** [@Fabboy17](https://discourse.processing.org/u/Fabboy17)\
**Replies:** 2\
**Last updated:** [November 14, 2018, 4:50am UTC](https://discourse.processing.org/t/can-u-help-me-with-this-interesting-game/5519 "2018-11-14T04:50:05Z")

</div>

Hi, I’m trying to make a game which consists of joining two points without touching the bombs that were generated. I have advanced a lot in the game, I have to do that when the player wins everything is restarted and th…

---

## [How to close a PShape with 2 arcs and two lines](https://discourse.processing.org/t/how-to-close-a-pshape-with-2-arcs-and-two-lines/5287)

<div class="topic-metadata">

**Author:** [@ddownn](https://discourse.processing.org/u/ddownn)\
**Replies:** 18\
**Last updated:** [November 14, 2018, 2:56am UTC](https://discourse.processing.org/t/how-to-close-a-pshape-with-2-arcs-and-two-lines/5287 "2018-11-14T02:56:59Z")

</div>

I’ve been trying to make a PShape like a segment of a color wheel, but I am not sure how to close it so I can use a stroke, and fills, and move them around on the screen easily. I don’t know whether I should try to find…

---

## [Rotate Sphere on its Axis](https://discourse.processing.org/t/rotate-sphere-on-its-axis/5505)

<div class="topic-metadata">

**Author:** [@ant](https://discourse.processing.org/u/ant)\
**Replies:** 3\
**Last updated:** [November 14, 2018, 1:36am UTC](https://discourse.processing.org/t/rotate-sphere-on-its-axis/5505 "2018-11-14T01:36:38Z")

</div>

Having trouble getting the bear to spin on its axis. Basically, I’m trying to get the bear to stand still but rotate around on its axis. float angle = PI/200; void setup() { size(1000,1000, P3D); frameRate(3); } vo…

---

## [How about the code when the ball is retracted and returned to its original position?](https://discourse.processing.org/t/how-about-the-code-when-the-ball-is-retracted-and-returned-to-its-original-position/5507)

<div class="topic-metadata">

**Author:** [@alk5603](https://discourse.processing.org/u/alk5603)\
**Replies:** 2\
**Last updated:** [November 14, 2018, 1:21am UTC](https://discourse.processing.org/t/how-about-the-code-when-the-ball-is-retracted-and-returned-to-its-original-position/5507 "2018-11-14T01:21:34Z")

</div>

float rot = PI; float d\_rot = 0.05; float xoff = 0.0; float xincrement = 0.01; //float xoff\_xincrement = 0.05; void setup() { size(800, 800); noStroke(); fill(255); } void draw() { background(0); …

---

## [Add images to particle system](https://discourse.processing.org/t/add-images-to-particle-system/5511)

<div class="topic-metadata">

**Author:** [@JimyiHendrix](https://discourse.processing.org/u/JimyiHendrix)\
**Replies:** 3\
**Last updated:** [November 13, 2018, 10:55pm UTC](https://discourse.processing.org/t/add-images-to-particle-system/5511 "2018-11-13T22:55:17Z")

</div>

Hello everyone. I would like tome convert those particles into an image. I mean every single particle in one image that i have from a picture, any. i leave here the code till i tried it. THANKS for your time!! //This is…

---

## [Detect closing another sketch](https://discourse.processing.org/t/detect-closing-another-sketch/5500)

<div class="topic-metadata">

**Author:** [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Replies:** 1\
**Last updated:** [November 13, 2018, 5:44pm UTC](https://discourse.processing.org/t/detect-closing-another-sketch/5500 "2018-11-13T17:44:39Z")

</div>

Note that this is outside the PDE, you need vscode / intelliJ / eclipse. My goal is to start a sketch, run that, and when it is closed either by me or some timer or whatever, run another sketch. For a sketch to run I c…

---

## [Andrew's monotone chain algorithm](https://discourse.processing.org/t/andrews-monotone-chain-algorithm/5485)

<div class="topic-metadata">

**Author:** [@Joanna](https://discourse.processing.org/u/Joanna)\
**Replies:** 2\
**Last updated:** [November 13, 2018, 2:46pm UTC](https://discourse.processing.org/t/andrews-monotone-chain-algorithm/5485 "2018-11-13T14:46:09Z")

</div>

Hello, I have a project for university about creating NURBs curves. One part of the code is Andrew’s monotone chain algorithm. And I have the code that doesn’t work, could anyone help me with that? Thank you so much! i…

---

## [Drawings within setup() after surface.setSize()](https://discourse.processing.org/t/drawings-within-setup-after-surface-setsize/5374)

<div class="topic-metadata">

**Author:** [@gyula](https://discourse.processing.org/u/gyula)\
**Replies:** 4\
**Last updated:** [November 12, 2018, 9:59am UTC](https://discourse.processing.org/t/drawings-within-setup-after-surface-setsize/5374 "2018-11-12T09:59:42Z")

</div>

I like to write simple pieces of code without a draw() block. In this way, it often doesn’t even have to be surrounded by the setup() function, since Processing will do that behind the scenes. When I brought over an old…

---

## [Connectingrods and crankshaft.... for flapping bird](https://discourse.processing.org/t/connectingrods-and-crankshaft-for-flapping-bird/5186)

<div class="topic-metadata">

**Author:** [@jfs](https://discourse.processing.org/u/jfs)\
**Replies:** 14\
**Last updated:** [November 13, 2018, 8:03am UTC](https://discourse.processing.org/t/connectingrods-and-crankshaft-for-flapping-bird/5186 "2018-11-13T08:03:59Z")

</div>

Hello everyone I try to code a little sketch that allows me to visualize the linkage between the wings and the crankshaft of a plane with flapping wings. For now I have “done” this allows me according to some configura…

---

## [Draw lines that go from bottom to top?](https://discourse.processing.org/t/draw-lines-that-go-from-bottom-to-top/5466)

<div class="topic-metadata">

**Author:** [@josie](https://discourse.processing.org/u/josie)\
**Replies:** 5\
**Last updated:** [November 13, 2018, 6:31am UTC](https://discourse.processing.org/t/draw-lines-that-go-from-bottom-to-top/5466 "2018-11-13T06:31:06Z")

</div>

Hi, I’m very new to processing, so I’m sorry if I make mistakes or have trouble understanding something. I wanted to design a code that drew x amount of lines starting at 0 and went up to the height of my setup then sto…

---

## [These functions doesn't exist, why?](https://discourse.processing.org/t/these-functions-doesnt-exist-why/5489)

<div class="topic-metadata">

**Author:** [@lyndsee](https://discourse.processing.org/u/lyndsee)\
**Replies:** 1\
**Last updated:** [November 13, 2018, 5:11am UTC](https://discourse.processing.org/t/these-functions-doesnt-exist-why/5489 "2018-11-13T05:11:00Z")

</div>

Hi all! I am new here, specifically signed up to resolve this problem. I have Processing 3. I am trying to make two “walkers”. I have all this code here but I keep getting the error message that the functions step(), re…

---

## [Increase the length of object array](https://discourse.processing.org/t/increase-the-length-of-object-array/5390)

<div class="topic-metadata">

**Author:** [@dragon\_hatcher](https://discourse.processing.org/u/dragon_hatcher)\
**Replies:** 14\
**Last updated:** [November 12, 2018, 10:47pm UTC](https://discourse.processing.org/t/increase-the-length-of-object-array/5390 "2018-11-12T22:47:08Z")

</div>

Hello Everyone, I’m just learning to use classes and I wanted to use an array to create the objects. I have it set up so that when I click it creates a new object at the mouses position. What I am wondering is how I can…

---

## [I want to know how this is expressed. 03](https://discourse.processing.org/t/i-want-to-know-how-this-is-expressed-03/5430)

<div class="topic-metadata">

**Author:** [@alk5603](https://discourse.processing.org/u/alk5603)\
**Replies:** 6\
**Last updated:** [November 12, 2018, 10:05pm UTC](https://discourse.processing.org/t/i-want-to-know-how-this-is-expressed-03/5430 "2018-11-12T22:05:23Z")

</div>

---

## [Inverting graphics and code](https://discourse.processing.org/t/inverting-graphics-and-code/5116)

<div class="topic-metadata">

**Author:** [@IdoPlumes](https://discourse.processing.org/u/IdoPlumes)\
**Replies:** 8\
**Last updated:** [November 12, 2018, 7:31pm UTC](https://discourse.processing.org/t/inverting-graphics-and-code/5116 "2018-11-12T19:31:47Z")

</div>

Hello, I am new to processing, but not so much coding as i have done a 2 years of audio process design and implementation at my current university, using c and c++ languages. However i am getting into the graphics worl…

---

## [Reversing the draw()/code?](https://discourse.processing.org/t/reversing-the-draw-code/5172)

<div class="topic-metadata">

**Author:** [@ReDeagle](https://discourse.processing.org/u/ReDeagle)\
**Replies:** 3\
**Last updated:** [November 12, 2018, 7:22pm UTC](https://discourse.processing.org/t/reversing-the-draw-code/5172 "2018-11-12T19:22:02Z")

</div>

Hey everyone, I have a project for school where parts of an object come flying in from different parts of a screen into the center to form a car. We aren’t allowed to use if statements either. I know how to code it so t…

---

## [Drawing the path of Mover under the influence of Attractor](https://discourse.processing.org/t/drawing-the-path-of-mover-under-the-influence-of-attractor/5463)

<div class="topic-metadata">

**Author:** [@ahariri72](https://discourse.processing.org/u/ahariri72)\
**Replies:** 3\
**Last updated:** [November 12, 2018, 4:56pm UTC](https://discourse.processing.org/t/drawing-the-path-of-mover-under-the-influence-of-attractor/5463 "2018-11-12T16:56:40Z")

</div>

Hi all, I am trying to track the movement of a mover class that is moving based on the gravity of a couple of attractors. I need to show the trajectory of this movement using lines/points. Currently the ellipse movement…

---

## [Get degree direction from point to point](https://discourse.processing.org/t/get-degree-direction-from-point-to-point/5464)

<div class="topic-metadata">

**Author:** [@Darkar25](https://discourse.processing.org/u/Darkar25)\
**Replies:** 1\
**Last updated:** [November 12, 2018, 7:30am UTC](https://discourse.processing.org/t/get-degree-direction-from-point-to-point/5464 "2018-11-12T07:30:48Z")

</div>

How can i get the degree direction from x1 y1 to x2 y2?example… x1 = 0 y1 = 0 x2 = 100 y2 = 100 Its equals 45°… I tried to make it myself but it not 100% accurate method…its showing 10-15 more degrees than needed…

---

## [Problem while creating a brick breaker game](https://discourse.processing.org/t/problem-while-creating-a-brick-breaker-game/5416)

<div class="topic-metadata">

**Author:** [@fritzpal](https://discourse.processing.org/u/fritzpal)\
**Replies:** 2\
**Last updated:** [November 11, 2018, 6:25pm UTC](https://discourse.processing.org/t/problem-while-creating-a-brick-breaker-game/5416 "2018-11-11T18:25:21Z")

</div>

Hi, Can somebody help me display the bricks correctly. I can´t get it to work. I think the problem is the array and how I determine the position of the bricks. Thank you! Here\`s the main Program: SpielerFlaeche play…

---

## [Loading data / Constructor problem](https://discourse.processing.org/t/loading-data-constructor-problem/5179)

<div class="topic-metadata">

**Author:** [@RC75018](https://discourse.processing.org/u/RC75018)\
**Replies:** 3\
**Last updated:** [November 11, 2018, 5:09pm UTC](https://discourse.processing.org/t/loading-data-constructor-problem/5179 "2018-11-11T17:09:32Z")

</div>

Hi Everyone, I am learning processing with Daniel @shiffman Book (learning processing + Youtube video) and got stuck at exercise 18-7 (Data input from text files). I can’t find the solution online, that is why i am ask…

---

## [Draw a curve that touches 3 points](https://discourse.processing.org/t/draw-a-curve-that-touches-3-points/5104)

<div class="topic-metadata">

**Author:** [@molo32](https://discourse.processing.org/u/molo32)\
**Replies:** 10\
**Last updated:** [November 11, 2018, 3:36pm UTC](https://discourse.processing.org/t/draw-a-curve-that-touches-3-points/5104 "2018-11-11T15:36:57Z")

</div>

Draw a curve that touches 3 points (1 starting point, 2 medium, 3 final) coordinates: 1 (10,10) 2 (100,200) (200,10) I must implement the curve function () without using libraries and manipulating pixels with pixel \[\] …

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

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