# P3D make something display on top!

**URL:** <https://discourse.processing.org/t/p3d-make-something-display-on-top/42302>\
**Category:** Beginners\
**Created:** [June 28, 2023, 8:57pm UTC](https://discourse.processing.org/t/p3d-make-something-display-on-top/42302 "2023-06-28T20:57:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nuhuhwy](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/nuhuhwy/32/18485_2.png) [@nuhuhwy](https://discourse.processing.org/u/nuhuhwy)\
**Post date:** [June 28, 2023, 8:57pm UTC](https://discourse.processing.org/t/p3d-make-something-display-on-top/42302/1 "2023-06-28T20:57:28Z")

</div>

How do i display gui in p3d always in front of everthing?  
if i try to do it like this:

```auto
box(256);
popMatrix();
  
  camera(); //resets viewport to 2D equivalent
  noLights();
  
  fill(60);
  rect(0,0,100,100);
  fill(255);
  text("erwrrw", 10, 50);

```

when i move the camera, sometimes the cube clips through the rectangle!

---

<div class="post-metadata">

**Author:** ![nuhuhwy](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/nuhuhwy/32/18485_2.png) [@nuhuhwy](https://discourse.processing.org/u/nuhuhwy)\
**Post date:** [June 28, 2023, 9:04pm UTC](https://discourse.processing.org/t/p3d-make-something-display-on-top/42302/2 "2023-06-28T21:04:52Z")

</div>

Solution:  
render the box in perspective mode:

```auto
perspective(PI/3.0, float(width)/float(height), 10, 100000);
camera( //...
box(100);
noLights();
camera(); //without anything
ortho(-width/2.0, width/2.0, -height/2.0, height/2.0, 10, 10000);

```

---

<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:** [June 28, 2023, 9:36pm UTC](https://discourse.processing.org/t/p3d-make-something-display-on-top/42302/3 "2023-06-28T21:36:39Z")

</div>

See number 9 : [25 life saving tips for processing (blogpost) - Processing Forum](https://forum.processing.org/one/topic/25-life-saving-tips-for-processing-blogpost.html)
