Hello! So i am trying to create this extruded square essentially that follows the path of an arc then straight line to produce something that kind of looks like a nike swoosh, but boxier. The extruded object is segmented to allow for some morph meshing. The following is the code for creating the path array for the extrusion.
var square = [new BABYLON.Vector3(-1, 1, -2),
new BABYLON.Vector3(1, 1, -2),
new BABYLON.Vector3(1, -1, 0),
new BABYLON.Vector3(-1, -1, 0),
new BABYLON.Vector3(-1, 1, -2)];
var pathLength = 6;
var pathSegments = 100;
var nbRects = 4;
var path = [
];
var bezCurve = BABYLON.Curve3.CreateQuadraticBezier(
new BABYLON.Vector3(0, 0, -1),
new BABYLON.Vector3(0, -1, 0),
new BABYLON.Vector3(0, -1, -1),
25);
//path.push(bezCurve);
for(var i=0; i<pathSegments; i++){
path.push(new BABYLON.Vector3(0, 0, -pathLength / 2 + pathLength * (i / (pathSegments - 1))));
}
When I try and start the path array with a curve, I get an error stating e[n].clone is not a function
.
Here is a link to what I have so far (with generous help from the forum here)