plane(w, h);
Draw a plane.
Arguments
w
The width dimensionh
The height dimensionfunction setup()
createWindow(300, 300, GL3D);
end
function draw()
background('purple');
plane(400, 400);
end
Output
box(w, [h], [d]);
Draw a 3D box.
Arguments
w
The width dimension[h]
The height dimension[d]
The depth dimensionfunction setup()
createWindow(300, 300, GL3D);
end
function draw()
background('purple');
box(150, 225, 180);
end
Output
function setup()
createWindow(300, 300, GL3D);
end
function draw()
background('purple');
rotateX(45);
rotateZ(45);
box(150, 225, 180);
end
Output
sphere(w, [detailX], [detailY]);
Draw a 3D Sphere.
Arguments
w
The width dimension[detailX]
The detail in the X axis[detailY]
the detailt in the Y axisfunction setup()
createWindow(300, 300, GL3D);
end
function draw()
background('purple');
sphere(200);
end
Output
cylinder([radius], [height], [detailX], [detailY], [bottomCap], [topCap]);
Draw a 3D Cylinder.
Arguments
[radius]
radius of the cylinder. Defaults to 50.[height]
height of the cylinder. Defaults to the value of radius.[detailX]
number of horizontal edges. Defaults to 24.[detailY]
number of subdivisions along the y[bottomCap]
whether to draw the cylinder[topCap]
whether to draw the cylinderfunction setup()
createWindow(300, 300, GL3D);
end
function draw()
background('purple');
cylinder(80, 140);
end
Output
torus([radius], [tubeRadius], [detailX], [detailY]);
Draw a 3D Torus.
Arguments
[radius]
radius of the torus. Defaults to 50.[tubeRadius]
radius of the tube. Defaults to 10.[detailX]
number of edges that form the hole. Defaults to 24.[detailY]
number of triangle subdivisions along the yfunction setup()
createWindow(300, 300, GL3D);
end
function draw()
background('purple');
torus(180, 80);
end
Output