Saint Louis University |
Computer Science 1050
|
Dept. of Math & Computer Science |
Our theme for today is Processing's support for three-dimensional graphics.
To use most of these features, you must explictly use a 3D renderer, indicated with an optional third parameter to the size() function, as in:
size(800, 800, P3D);
For background reading, we recommend Danniel Shiffman's P3D tutorial from the Processing website.
For the rest of these notes, we just demo a few of our own sketches.
3D Rotations
This next demo is far more impressive when running directly in Processing rather than through a browser...
Demo: source code
3D Rotations with User Controls
In this version, the user can click and drag to rotate the image along
both X and Y axes.
Demo: source code
3D Rotations with Text
Demo: source code
Sphere primitive
Demo: source code
User controls: