# Why does size() create different window sizes depending on whether P3D is used?

**URL:** <https://discourse.processing.org/t/why-does-size-create-different-window-sizes-depending-on-whether-p3d-is-used/42537>\
**Category:** Processing\
**Created:** [August 2, 2023, 12:42am UTC](https://discourse.processing.org/t/why-does-size-create-different-window-sizes-depending-on-whether-p3d-is-used/42537 "2023-08-02T00:42:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jtbr](https://avatars.discourse-cdn.com/v4/letter/j/bbce88/32.png) [@jtbr](https://discourse.processing.org/u/jtbr)\
**Post date:** [August 2, 2023, 12:42am UTC](https://discourse.processing.org/t/why-does-size-create-different-window-sizes-depending-on-whether-p3d-is-used/42537/1 "2023-08-02T00:42:05Z")

</div>

I just discovered that the size() function creates different window sizes depending on whether P3D is selected. When I called size(1024,600,P3D), the window size is about quarter of that when using size(1024,600) (no P3D). See the attached image.

Does anyone have any explanation for this behaviour?

 ![size1024x600_2](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/f/e/fecd8a8e81a65946d330b7f0e894f8620c6b83fd.png)

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [August 2, 2023, 6:44am UTC](https://discourse.processing.org/t/why-does-size-create-different-window-sizes-depending-on-whether-p3d-is-used/42537/2 "2023-08-02T06:44:24Z")

</div>

Hi @jtbr,

I can’t reproduce it. For me both windows have the expected dimension.

Cheers  
— mnse

 ![AA1](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/9/7/97b66f246a05f9c482c31b3540ff118dc5f8f881.png)  
 ![AA2](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/e/2/e235048bd6f2fca2fd5de2f825c1c317d85cb685.png)

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [August 2, 2023, 10:57am UTC](https://discourse.processing.org/t/why-does-size-create-different-window-sizes-depending-on-whether-p3d-is-used/42537/3 "2023-08-02T10:57:26Z")

</div>

Hello @jtbr,

Which version of Processing?  
What operating system?

Related discussions:

> [@The render window is scaled improperly when Windows display scale is set to greater than 100%](https://discourse.processing.org/t/the-render-window-is-scaled-improperly-when-windows-display-scale-is-set-to-greater-than-100/36932):
>
> Hi. I have a QHD monitor (2560x1440), and I have my display scale set to 150% for readability. Unfortunately, in Python mode, the render window is also scaled up the same amount, making things very jagged. I didn’t realize the issue until comparing a test code in both Python and Java mode. When I switch it to 100% scale, they both render the same. Is this a bug? Is there code I can add to make it work properly? I’ve tested a lot and nothing seems to work. Thanks in advance.

> [@Decreased quality when coding outside the Processing IDE](https://discourse.processing.org/t/decreased-quality-when-coding-outside-the-processing-ide/40818):
>
> After many years with Processing IDE, I missed Intellij IDEA too much so I went back for it but Processing stays on wink However, the shapes drawn are way less sharp than in the real PDE, for example, a simple circle is rendered differently using both time the latest version of Processing available 4.1.2, the same PC and the same monitor : In PDE : public void setup() { size(500, 500); } public void draw() { background(40); noStroke(); fill(255); circle(width/2, height…

`:)`

---

<div class="post-metadata">

**Author:** ![jtbr](https://avatars.discourse-cdn.com/v4/letter/j/bbce88/32.png) [@jtbr](https://discourse.processing.org/u/jtbr)\
**Post date:** [August 2, 2023, 11:23am UTC](https://discourse.processing.org/t/why-does-size-create-different-window-sizes-depending-on-whether-p3d-is-used/42537/4 "2023-08-02T11:23:08Z")

</div>

Processing 4.2  
Windows 10

I don’t know the graphics information will be useful.  
NVIDIA RTX A2000 8GB  
DirectX 12

---

<div class="post-metadata">

**Author:** ![jtbr](https://avatars.discourse-cdn.com/v4/letter/j/bbce88/32.png) [@jtbr](https://discourse.processing.org/u/jtbr)\
**Post date:** [August 3, 2023, 4:16am UTC](https://discourse.processing.org/t/why-does-size-create-different-window-sizes-depending-on-whether-p3d-is-used/42537/5 "2023-08-03T04:16:28Z")

</div>

Interestingly, when I added an external 7" monitor (1024 x 600) and moved the window (using `size(1024,600,P3D)`) to this monitor, it “became bigger” and actually fit to the full screen.

When I did the same without P3D, the window size was slightly smaller than the full screen.

I still have no explanation but I’m satisfied that size() with P3D option fits onto my target monitor.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [August 3, 2023, 9:52am UTC](https://discourse.processing.org/t/why-does-size-create-different-window-sizes-depending-on-whether-p3d-is-used/42537/6 "2023-08-03T09:52:48Z")

</div>

my theory:

maybe you use a tablet/laptop computer?

maybe you told the internal monitor to be rotated 90° and processing can’t read this information and thus the width and height parameters in the size-command are swapped?

Chrisir

---

<div class="post-metadata">

**Author:** ![jtbr](https://avatars.discourse-cdn.com/v4/letter/j/bbce88/32.png) [@jtbr](https://discourse.processing.org/u/jtbr)\
**Post date:** [August 3, 2023, 10:36am UTC](https://discourse.processing.org/t/why-does-size-create-different-window-sizes-depending-on-whether-p3d-is-used/42537/7 "2023-08-03T10:36:45Z")

</div>

Hi Chrisir,

Thank you. That’s a very good point.

My display setting is scaled to 250% by default. After more testing switching between 100% and 250%, I found that `size(*,*,P3D)` ignored the scale but `size(*,*)` followed the scale.
