I am trying to make the blue rectangle go over the top of the red one without going over the yellow one, I am only allowed to use 4 rectangles. I have tried to do this using PShape but have come up short, was wondering if someone could help me?
I used P3D in above and later different z values for corners; they are all the same in my example only.
The original shape is from here: beginShape() / Reference / Processing.org
Heya @niftynathan7 and thanks for sharing that interesting brain teaser! This kinda sounds like a homework-related question. If that is actually the case, could you please add a “homework” label to your post? Thanks!
I always enjoy brain-teasers so I had a go myself and got this
Since it appears to be homework I will not include the source code but it follows the approach I suggested earlier and you can see how to use vertex in 3D from @glv’s replay.