xxxxxxxxxx
26
function setup() {
createCanvas3D(600, 400);
background3D("#333333");
diffuse("#4CAF50");
roughness(0.1)
//We create a 2D shape specifying each vertex
var myShape = beginShape2D();
addVertex(-0.5, -2.5);
addVertex(0.5, -2.5);
addVertex(0.5, 2.5);
addVertex(-0.5, 2.5);
endShape();
//No bevel
shape(myShape, -2, 0, 0, 0.1);
//Using default bevel
shape(myShape, 0, 0, 0, 0.5, true);
//With all parameters we can generate different bevels
shape(myShape, 2, 0, 0, 0.1, true, 0.2, 0.2, -0.1, 32);
}
function draw() {}