Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
3 Cards in this Set
- Front
- Back
box()
|
Examples
size(100, 100, P3D); translate(58, 48, 0); rotateY(0.5); noFill(); box(40); size(100, 100, P3D); translate(58, 48, 0); rotateY(0.5); noFill(); box(40, 20, 50); Syntax box(size) box(w, h, d) Parameters size float: dimension of the box in all dimensions (creates a cube) w float: dimension of the box in the x-dimension h float: dimension of the box in the y-dimension d float: dimension of the box in the z-dimension |
|
sphere()
|
Example
noStroke(); lights(); translate(58, 48, 0); sphere(28); Syntax sphere(r) Parameters r float: the radius of the sphere |
|
sphereDetail()
|
Cntrls the detl used to render a sphere by adjstng the nmbr of vertices of the sphere mesh. The dflt resolution is 30, which creates a dtld sphere defini with vertices every 360/30 = 12 degrees. The setting stays active until sphereDetail() is called again with a new parameter and so should not be called prior to every sphere() statement, unless you wish to render spheres with different settings, e.g. using less detail for smaller spheres or ones further away from the camera. To control the detail of the horizontal and vertical resolution independently, use the version of the functions with two parameters.
Example void setup() { size(100, 100, P3D); } void draw() { background(200); stroke(255, 50); translate(50, 50, 0); rotateX(mouseY * 0.05); rotateY(mouseX * 0.05); fill(mouseX * 2, 0, 160); sphereDetail(mouseX / 4); sphere(40); } Syntax sphereDetail(res) sphereDetail(ures, vres) |