In the 2D canvas, the createCanvas() function contains the two parameters of "windowWidth" and "windowHeight"
createCanvas(windowWidth, windowHeight);
In the 3D canvas, the createCanvas() function contains three parameters "windowWidth", "windowHeight" and the third parameter of "WEBGL", which turns a 2D canvas into a 3D canvas.
createCanvas(windowWidth, windowHeight, WEBGL);