Question: three.js and javascript programming Write a function createCylinder(n, len, rad, isCappedBottom, isCappedTop) that creates the geometry of an n -sided open cylinder of radius rad

three.js and javascript programming

Write a function createCylinder(n, len, rad, isCappedBottom, isCappedTop) that creates the geometry of an n-sided open cylinder of radius rad and length len, centered at the origin and aligned with the y-axis. isCappedBottom and isCappedTop indicate whether the cylinder is capped by bottom and top faces, respectively; if arguments are not supplied, they default to false. Below, the first image's geometry was constructed by the call createCylinder(12, 6, 2) and the second by the call createCylinder(12, 6, 2, true).

createCylinder(n, len, rad, isCappedBottom, isCappedTop) {

}

try { init(); createScene(); addToDOM(); render(); animate(); } catch(e) { var errorMsg = "Error: " + e; document.getElementById("msg").innerHTML = errorMsg; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!