# How to hack 3d using 2d using simple graphics API to display a cuboid?

**URL:** <https://forum.kirupa.com/t/how-to-hack-3d-using-2d-using-simple-graphics-api-to-display-a-cuboid/677084>\
**Category:** programming\
**Created:** [August 30, 2025, 10:21am UTC](https://forum.kirupa.com/t/how-to-hack-3d-using-2d-using-simple-graphics-api-to-display-a-cuboid/677084 "2025-08-30T10:21:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oslon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/oslon/32/24631_2.png) [@oslon](https://forum.kirupa.com/u/oslon)\
**Post date:** [August 30, 2025, 10:21am UTC](https://forum.kirupa.com/t/how-to-hack-3d-using-2d-using-simple-graphics-api-to-display-a-cuboid/677084/1 "2025-08-30T10:21:17Z")

</div>

![image](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/9/b/9b5f3bf62a686b554e7e97ae5dcb45b7b3a5a62a.png)

I want to display something like this. Using entirely 2d parameters. To my small brain, this requires z-axis concepts as well. x,y axes is not enough.  
I tried to draw with only x and y axes and I got them one after another. I am suspecting I need to translate back in z axis. But I would love some feedback from this forum. I will try and let you know. I am doing in Javafx API but I genuinely do not think that matters at all.

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [September 2, 2025, 4:30pm UTC](https://forum.kirupa.com/t/how-to-hack-3d-using-2d-using-simple-graphics-api-to-display-a-cuboid/677084/2 "2025-09-02T16:30:41Z")

</div>

@senocular’s content from a few decades ago is perfect for this: [kirupa.com - Exploring 3D in Flash](https://www.kirupa.com/developer/actionscript/3dindex.htm) (⁉)

The general idea is to have a consideration for the z axis that translates everything into x and y coordinations. For a more modern version of how to do this, this article may help:

> **[Creating an Animated 3D Starfield Effect](https://www.kirupa.com/animations/animated_3d_starfield_effect.htm)**
>
> Learn how to create this fun effect where we simulate us flying past endless stars in outer space.
