# Create a 3d box inside a 2d project

**URL:** <https://discourse.processing.org/t/create-a-3d-box-inside-a-2d-project/21051>\
**Category:** Libraries\
**Created:** [May 19, 2020, 1:49pm UTC](https://discourse.processing.org/t/create-a-3d-box-inside-a-2d-project/21051 "2020-05-19T13:49:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cwr0ng](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@cwr0ng](https://discourse.processing.org/u/cwr0ng)\
**Post date:** [May 19, 2020, 1:49pm UTC](https://discourse.processing.org/t/create-a-3d-box-inside-a-2d-project/21051/1 "2020-05-19T13:49:40Z")

</div>

Hello guys,  
I’m a processing beginner. I’d like to plot a 3d spectrum inside my 2d application (it will be an equalizer at the end).  
This is my setup, I’d like to have the second half of the application plotting a spectrum but I’d like to make it 3d. Any suggestions?  
 ![immagine](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4c8bdf3782f22a16a7c3d8db3222a670b9d38321.png)  
I’ve thought to make the whole canvas 3d and then work with z axis only for the spectrum, but in my mind I need to rotate y-z axis :\

Thank you for your time.

---

<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:** [May 19, 2020, 2:16pm UTC](https://discourse.processing.org/t/create-a-3d-box-inside-a-2d-project/21051/2 "2020-05-19T14:16:18Z")

</div>

Its the other way round

Set your sketch as a 3D sketch (using size() with P3D), draw 3D things then repeat camera(); command and draw 2D stuff on top

---

<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:** [May 19, 2020, 2:17pm UTC](https://discourse.processing.org/t/create-a-3d-box-inside-a-2d-project/21051/3 "2020-05-19T14:17:27Z")

</div>

See number 9 here

> **[25 life-saving tips for Processing](https://amnonp5.wordpress.com/2012/01/28/25-life-saving-tips-for-processing/)**
>
> I have bundled a huge number and variety of code examples in this single mega-post. Please learn from my mistakes and experiences! ;-)

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [May 19, 2020, 2:35pm UTC](https://discourse.processing.org/t/create-a-3d-box-inside-a-2d-project/21051/4 "2020-05-19T14:35:48Z")

</div>

Create an offscreen P3D graphics buffer draw the spectrum to that then in draw() use image(…) to copy the buffer to the display. The base application should be P2D not the default JAVA2D
