# Running a processing java app on a raspberry pi changes everything over the Y axis

**URL:** <https://discourse.processing.org/t/running-a-processing-java-app-on-a-raspberry-pi-changes-everything-over-the-y-axis/34861>\
**Category:** Processing for Pi\
**Created:** [January 27, 2022, 2:18pm UTC](https://discourse.processing.org/t/running-a-processing-java-app-on-a-raspberry-pi-changes-everything-over-the-y-axis/34861 "2022-01-27T14:18:59Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![LucaP](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@LucaP](https://discourse.processing.org/u/LucaP)\
**Post date:** [January 27, 2022, 2:19pm UTC](https://discourse.processing.org/t/running-a-processing-java-app-on-a-raspberry-pi-changes-everything-over-the-y-axis/34861/1 "2022-01-27T14:19:00Z")

</div>

Hi,

I am putting some text inside of a box by using the text() function and passing in the coordinates of the center of the box. I am also centering the text with textAlign(CENTER, CENTER) On windows, this produces the following result:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/42126d1fae5b579409bae1213bb85dc825426254.png)

If I run the built artifact (I use intellij) on a raspberry pi with the java -jar command, it produces this result: (please don’t look at the upside down, that is not the point 🙂 )

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/719e25b438739d8dbd41f87da557f694b72f0f14.png)

This happens when using the Prometo font, a font I import during setup. I am also using the textMode(SHAPE) command and the P2D renderer with the raspbian opengl fake KMS drivers enabled. Changing to non P2D and turning off shape mode does not solve the problem.

Any ideas as to how I can fix this?

---

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [January 27, 2022, 3:21pm UTC](https://discourse.processing.org/t/running-a-processing-java-app-on-a-raspberry-pi-changes-everything-over-the-y-axis/34861/2 "2022-01-27T15:21:05Z")

</div>

Probably something to with [processing coordinate system](https://processing.org/tutorials/coordinatesystemandshapes). As a work around you could probably use [scale(1, -1, 1)](https://processing.org/reference/scale_.html) might need to push/pop matrix.

---

<div class="post-metadata">

**Author:** ![LucaP](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@LucaP](https://discourse.processing.org/u/LucaP)\
**Post date:** [January 27, 2022, 3:22pm UTC](https://discourse.processing.org/t/running-a-processing-java-app-on-a-raspberry-pi-changes-everything-over-the-y-axis/34861/3 "2022-01-27T15:22:25Z")

</div>

Would scale(1, -1) suffice for P2D? Im only doing 2D stuff.

---

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [January 27, 2022, 3:24pm UTC](https://discourse.processing.org/t/running-a-processing-java-app-on-a-raspberry-pi-changes-everything-over-the-y-axis/34861/4 "2022-01-27T15:24:03Z")

</div>

I think so but you might need translate as well (or otherwise calculate correct coordinates).

---

<div class="post-metadata">

**Author:** ![LucaP](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@LucaP](https://discourse.processing.org/u/LucaP)\
**Post date:** [January 27, 2022, 3:25pm UTC](https://discourse.processing.org/t/running-a-processing-java-app-on-a-raspberry-pi-changes-everything-over-the-y-axis/34861/5 "2022-01-27T15:25:12Z")

</div>

Scaling with scale(1, -1) and then translate(0, height) only makes the entire picture 180 degrees upside down, it does not affect the vertical alignment of the text in the rectangles.

---

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [January 27, 2022, 3:52pm UTC](https://discourse.processing.org/t/running-a-processing-java-app-on-a-raspberry-pi-changes-everything-over-the-y-axis/34861/6 "2022-01-27T15:52:58Z")

</div>

The [geomerative library](http://www.ricardmarxer.com/geomerative/) (doesn’t seem to be supported anymore), but its brilliant at manipulating text, you could try that. See it in [action here.](https://discourse.processing.org/t/bringing-a-geomerative-library-3d-text-sketch-up-to-date/21860)

---

<div class="post-metadata">

**Author:** ![LucaP](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@LucaP](https://discourse.processing.org/u/LucaP)\
**Post date:** [January 28, 2022, 11:06am UTC](https://discourse.processing.org/t/running-a-processing-java-app-on-a-raspberry-pi-changes-everything-over-the-y-axis/34861/7 "2022-01-28T11:06:25Z")

</div>

I just tried with a different screen and the problem no longer happens. Very interesting 🙂

I was also noticing that my circles were slightly ‘squeezed’, they were shorter in Y than in X, this also does not happen with a different screen. It seems something is wrong in the Y axis with some of my screens. The screen that is having the Y issue is a official raspberry pi touchscreen connected trough the DSI connector, connecting it trough HDMI has the same issue. Connecting the raspberry to a normal HDMI monitor, the issue is gone 😮

Would there be any way to debug why this happens so I can fix it? It needs to work with the other screen as well.

---

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [January 28, 2022, 2:49pm UTC](https://discourse.processing.org/t/running-a-processing-java-app-on-a-raspberry-pi-changes-everything-over-the-y-axis/34861/8 "2022-01-28T14:49:30Z")

</div>

It seems it is possible to rotate screen orientation [Raspberry Pi Documentation - Display](https://www.raspberrypi.com/documentation/accessories/display.html)

---

<div class="post-metadata">

**Author:** ![LucaP](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@LucaP](https://discourse.processing.org/u/LucaP)\
**Post date:** [January 28, 2022, 3:01pm UTC](https://discourse.processing.org/t/running-a-processing-java-app-on-a-raspberry-pi-changes-everything-over-the-y-axis/34861/9 "2022-01-28T15:01:05Z")

</div>

Yes, I know. But rotation is not my issue, the Y alignment is the issue.

---

<div class="post-metadata">

**Author:** ![LucaP](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@LucaP](https://discourse.processing.org/u/LucaP)\
**Post date:** [January 30, 2022, 11:29am UTC](https://discourse.processing.org/t/running-a-processing-java-app-on-a-raspberry-pi-changes-everything-over-the-y-axis/34861/10 "2022-01-30T11:29:04Z")

</div>

Bump. Does anyone know why the Y seems squeezed on these displays?
