# Draw order in 3D

**URL:** <https://discourse.processing.org/t/draw-order-in-3d/4789>\
**Category:** Coding Questions\
**Created:** [October 24, 2018, 1:00am UTC](https://discourse.processing.org/t/draw-order-in-3d/4789 "2018-10-24T01:00:28Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [October 24, 2018, 8:45pm UTC](https://discourse.processing.org/t/draw-order-in-3d/4789/9 "2018-10-24T20:45:50Z")

</div>

The issue above was with translateZ(-150) vs translateZ(150). So a question of which direction is forward / back.

Also notice that coordinates when using PeasyCam work differently than the default 3D cam.

Even once this is worked out:

Note however, with transparent object 3D CAN still sometimes have problems with drawing behind-things in front of in-front things. For fixing that, use `hint()`.

> [@Program to test hint() with transparency](https://discourse.processing.org/t/program-to-test-hint-with-transparency/4361):
>
> A small Processing program to test the effect on transparency of enabling and disabling these settings: hint(DISABLE\_DEPTH\_TEST); // or ENABLE\_ hint(DISABLE\_DEPTH\_SORT); // or ENABLE\_ hint(DISABLE\_DEPTH\_MASK); // or ENABLE\_ boolean b[] = new boolean[3]; void setup() { size(800, 600, P3D); hint(DISABLE\_DEPTH\_TEST); hint(DISABLE\_DEPTH\_SORT); hint(DISABLE\_DEPTH\_MASK); } void draw() { background(255); fill(0); text("DEPTH\_TEST " + b[0]…

This can also apply to strokes – so if you are rendering a sphere with strokes, that can be the issue. See hamoids demo sketch and try clicking settings on and off to get a sense of how strokes can pop-through in surprising ways.

---

_[View the full topic](https://discourse.processing.org/t/draw-order-in-3d/4789)._
