As I update a script to a newer version of three.js, I encountered an issue with ParametricGeometry. The error message "THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter" keeps appearing. Below is the section of code causing the problem:
var restDistance = 20;
var xSegs = 15;
var ySegs = 10;
var clothFunction = plane(restDistance * xSegs, restDistance * ySegs, zSegs);
var cloth = new Cloth(xSegs, ySegs);
clothGeometry = new THREE.ParametricGeometry( clothFunction, cloth.w, cloth.h, true );
It seems that the error is related to the clothFunction. I attempted to update it as follows, but the error persists - what could I be missing?
var clothFunction = function (u, v) {
return new THREE.Vector3(restDistance * xSegs, restDistance * ySegs, 1);
};