# Adding a border to the window in a P3D environment?

**URL:** <https://discourse.processing.org/t/adding-a-border-to-the-window-in-a-p3d-environment/29853>\
**Category:** Beginners\
**Created:** [May 4, 2021, 4:07pm UTC](https://discourse.processing.org/t/adding-a-border-to-the-window-in-a-p3d-environment/29853 "2021-05-04T16:07:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chubbulus](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chubbulus/32/13049_2.png) [@Chubbulus](https://discourse.processing.org/u/Chubbulus)\
**Post date:** [May 4, 2021, 4:07pm UTC](https://discourse.processing.org/t/adding-a-border-to-the-window-in-a-p3d-environment/29853/1 "2021-05-04T16:07:38Z")

</div>

Hi. How would I apply a border to the window when I have a P3D environment?

What I mean is that I want the object that is floating below my ship model to instead be locked to the edges of the screen.as a border.

I’m using PeasyCam as an easy way to move a camera around the environment, so setting the picture to the correct position and keeping it there isn’t an option.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/5/5fd3f0ba47c430ab2f4049e33ca777c34159d4a3.jpeg)

---

<div class="post-metadata">

**Author:** ![Shwaa](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/shwaa/32/9696_2.png) [@Shwaa](https://discourse.processing.org/u/Shwaa)\
**Post date:** [May 4, 2021, 4:26pm UTC](https://discourse.processing.org/t/adding-a-border-to-the-window-in-a-p3d-environment/29853/2 "2021-05-04T16:26:00Z")

</div>

If what you want to do is draw this as an image like a GUI, I made a topic a while ago about making a GUI in a 3D sketch, which is like having a 2D canvas in front of the camera:

> [@Drawing 2D GUI over a 3D sketch](https://discourse.processing.org/t/drawing-2d-gui-over-a-3d-sketch/22819):
>
> I’m making a 3D game, and a problem I ran into was drawing a 2D GUI over top of the main 3D sketch. The solution I found is pretty simple, but it works really well: //IMPORTANT: make sure to use textMode(SHAPE) before using this!! Otherwise text will be drawn as black boxes. //GUI hint(DISABLE\_DEPTH\_TEST); //draws on top of whatever is drawn on screen camera(); //reset camera to default position, which conveniently lines up with the screen exactly ortho(); //orthographic projection r…

It’s relatively simple to implement, but I’m not sure how it plays with peasycam.

EDIT: A comment on the linked topic shows you how to draw a GUI using peasycam

---

<div class="post-metadata">

**Author:** ![Chubbulus](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chubbulus/32/13049_2.png) [@Chubbulus](https://discourse.processing.org/u/Chubbulus)\
**Post date:** [May 4, 2021, 6:53pm UTC](https://discourse.processing.org/t/adding-a-border-to-the-window-in-a-p3d-environment/29853/3 "2021-05-04T18:53:19Z")

</div>

Thanks a ton! That helped me a lot!!!

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/699edced412c361c056b75eb1f007cfae525866d.jpeg)
