# How to place Transparent glass over human body..idea request

**URL:** https://discourse.processing.org/t/how-to-place-transparent-glass-over-human-body-idea-request/17273
**Category:** Coding Questions
**Created:** [January 23, 2020, 2:26am UTC](https://discourse.processing.org/t/how-to-place-transparent-glass-over-human-body-idea-request/17273 "2020-01-23T02:26:51Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![adaptinnovative](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@adaptinnovative](https://discourse.processing.org/u/adaptinnovative)
#### Post date: [January 23, 2020, 2:26am UTC](https://discourse.processing.org/t/how-to-place-transparent-glass-over-human-body-idea-request/17273/1 "2020-01-23T02:26:51Z")

</div>

![stances](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/a6ddf6a98127b3b0a5f8c6773bbc256de2cf0f9e.jpeg)

Any idea how to get this done in processing. I can load the human figure as an .obj file but to get the transparent slab of glass to be

- Frontal
- Sagittal
- Transverse

As seen in the image. Any ideas?

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [January 23, 2020, 4:02am UTC](https://discourse.processing.org/t/how-to-place-transparent-glass-over-human-body-idea-request/17273/2 "2020-01-23T04:02:52Z")

</div>

i not have a good 3D object, but start easy:

```auto
float ang = 0;

void setup() {
  size(400,400,P3D);
  noStroke();
  hint(ENABLE_DEPTH_SORT);
}

void draw(){
  background(200,200,0);
  translate(width/2,height/2);
  rotateY(ang);
  fill(0,0,200,50);
  rect(-100,-100,200,200);
  rotateX(2*ang);
  fill(200,0,0);
  box(40);
  ang +=0.01;
}

```

 ![P3D_transparentPlane](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/b/b7d6d1b0136ccb93d700402b5be7cfdc60f331ed.png)

---

<div class="post-metadata">

### Author: ![adaptinnovative](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@adaptinnovative](https://discourse.processing.org/u/adaptinnovative)
#### Post date: [January 25, 2020, 10:36am UTC](https://discourse.processing.org/t/how-to-place-transparent-glass-over-human-body-idea-request/17273/3 "2020-01-25T10:36:21Z")

</div>

Thanks so much. I take it enabling the depth sorting helps considerably?

---

<div class="post-metadata">

### Author: ![adaptinnovative](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@adaptinnovative](https://discourse.processing.org/u/adaptinnovative)
#### Post date: [January 25, 2020, 10:46am UTC](https://discourse.processing.org/t/how-to-place-transparent-glass-over-human-body-idea-request/17273/4 "2020-01-25T10:46:40Z")

</div>

I find that using OPENGL also does a nice job albeit the transparency is gone.

```auto
import processing.opengl.*;

float ang = 0;

void setup() {
  size(400,400,OPENGL);

  noStroke();
 // hint(ENABLE_DEPTH_SORT); //enables the effect
}

void draw(){
  background(128,128,128);
  translate(width/2,height/2);
  rotateY(ang);
  fill(0,0,200,50);
  rect(-100,-100,200,200);
  
  rotateX(2*ang);
  fill(200,0,0);
  box(40);
  
  
  ang +=0.01;
}

```

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [January 25, 2020, 11:25am UTC](https://discourse.processing.org/t/how-to-place-transparent-glass-over-human-body-idea-request/17273/5 "2020-01-25T11:25:50Z")

</div>

> [@adaptinnovative](#):
>
> OPENGL

sorry, while

> OPENGL is deprecated

i actually not know if there could be differences to P3D already??

---

<div class="post-metadata">

### Author: ![adaptinnovative](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@adaptinnovative](https://discourse.processing.org/u/adaptinnovative)
#### Post date: [January 26, 2020, 3:52am UTC](https://discourse.processing.org/t/how-to-place-transparent-glass-over-human-body-idea-request/17273/6 "2020-01-26T03:52:37Z")

</div>

Yes I prefer Processing 1.5.1 version as it has some great features that the new versions deprecated like you said.

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [January 26, 2020, 5:01am UTC](https://discourse.processing.org/t/how-to-place-transparent-glass-over-human-body-idea-request/17273/7 "2020-01-26T05:01:32Z")

</div>

> [@adaptinnovative](#):
>
> that the new versions deprecated like you said.

sounds like a misunderstanding,

anyhow if you work with other than current version better tell us in your topic?

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [January 26, 2020, 12:47pm UTC](https://discourse.processing.org/t/how-to-place-transparent-glass-over-human-body-idea-request/17273/8 "2020-01-26T12:47:00Z")

</div>

Hello,

The posted code runs the same with P3D as the renderer; in this case OPENGL is replaced with P3D.

Some insight into what Processing is doing behind the scenes here:

> <https://github.com/processing/processing/blob/master/core/src/processing/core/PConstants.java#L65-L67>

I clicked on OPENGL to show the _warning_:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/c5fb21cad746733029ff83481da6aad217b4bc08.png)

Some additional references related to OPENGL:  
[https://github.com/processing/processing/wiki/Advanced-OpenGL](https://github.com/processing/processing/wiki/Advanced-OpenGL)  
[https://github.com/processing/processing/wiki/Advanced-OpenGL-in-Processing-2.x](https://github.com/processing/processing/wiki/Advanced-OpenGL-in-Processing-2.x)  
[https://github.com/processing/processing/wiki/OpenGL-Issues](https://github.com/processing/processing/wiki/OpenGL-Issues)

[https://processing.org/reference/environment/](https://processing.org/reference/environment/)  
[https://processing.org/tutorials/rendering/](https://processing.org/tutorials/rendering/)  
[https://processing.org/tutorials/p3d/](https://processing.org/tutorials/p3d/)  
[https://processing.org/tutorials/pshader/](https://processing.org/tutorials/pshader/)

🙂

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [January 26, 2020, 1:25pm UTC](https://discourse.processing.org/t/how-to-place-transparent-glass-over-human-body-idea-request/17273/9 "2020-01-26T13:25:54Z")

</div>

> [@Hooray! New hint() documentation is available!](https://discourse.processing.org/t/hooray-new-hint-documentation-is-available/13056):
>
> Thanks to Casey we now have a new reference page for hint() and related arcane constants: [https://processing.org/reference/hint\_.html](https://processing.org/reference/hint_.html) This is specially useful for those working with P3D, and otherwise for people who want to fine tune the drawing quality/performance balance. smile
