Hello,
Here is an example to start with:
This will work for a cube as well.
You will have to add a z to the vertices and align your uv coordinates correctly.
I just did it for one face and rotated so you could see it:
There is a an example in the Processing IDE here:
Walk through the code and explore the tutorials and references as necessary.
One of the best tools in a programmers tool chest is knowing the resources available to you and learning to navigate, filter and use them.
This is a very short list:
Resources < Click here to expand !
I encourage you to review the resources available here:
- The Processing website has references, examples, tutorials, etc.
https://processing.org/ - The Processing PDE (IDE) has lots to offer!
An exploration of the tabs will reveal what is available; libraries, tools and local examples there. - The Coding Train
https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw
https://thecodingtrain.com/ - Happy Coding
Processing Tutorials - Happy Coding - The source code can give insight if you are adventurous:
GitHub - processing/processing: Source code for the Processing Core and Development Environment (PDE)
Many of the Processing functions are here:
processing/core/src/processing/core/PApplet.java at master · processing/processing · GitHub - The Processing Foundation
https://processingfoundation.org/
Check out the tabs.
In the education tab, there is a reference to the Coding Train. - And the Internet.
:)
I expect that there are other ways to do this as well.
I will leave the rest of the exploration to you.
:)