xxxxxxxxxx
32
function setup() {
createCanvas3D(600, 400);
background3D("#333333");
diffuse("#4895ef");
//capsule(x, y, z, radius, length)
capsule(-5, 0, 0, 0.25, 1);
//sphere(x, y, z, radius)
sphere(-4, 0, 0, 0.5);
//cube(x, y, z, side)
cube(-3, 0, 0, 0.7);
//box(x, y, z, width, height, depth)
box(-2, 0, 0, 0.2, 1, 0.4);
//cylinder(x, y, z, radius, height)
cylinder(-1, 0, 0, 0.2, 1);
//icosahedron(x, y, z, radius)
icosahedron(0, 0, 0, 0.7);
//ellipsoid(x, y, z, width, height, depth)
ellipsoid(1, 0, 0, 0.5, 1, 2);
//cone(x, y, z, radius, height)
cone(2, 0, 0, 0.6, 0.5);
//torus(x, y, z, radius, tubeRadius)
torus(3, 0, 0, 0.3, 0.1);
//octahedron(x, y, z, radius)
octahedron(4, 0, 0, 0.3);
//(x, y, z, radius)
tetrahedron(5, 0, 0, 0.3);
}
function draw() {
// 🔍 Never create objects here, but don't forget to have it in your code
}