いろいろな形状シリーズです。
いきましょう!
線
//Array of points to construct lines var myPoints = [ new BABYLON.Vector3(0, 0, 0), new BABYLON.Vector3(0, 1, 1), new BABYLON.Vector3(0, 1, 0) ]; //Create lines var lines = BABYLON.MeshBuilder.CreateLines("lines", {points: myPoints}, scene);
BABYLON.Vector3型で繋いでいきます
螺旋
//Array of points to construct a spiral with lines var myPoints = []; var deltaTheta = 0.1; var deltaY = 0.005; var radius = 1; var theta = 0; var Y = 0; for (var i = 0; i<400; i++) { myPoints.push(new BABYLON.Vector3(radius * Math.cos(theta), Y, radius * Math.sin(theta))); theta += deltaTheta; Y += deltaY } //Create lines var lines = BABYLON.MeshBuilder.CreateLines("lines", {points: myPoints}, scene);
線400個を螺旋状に繋いでグルグルな物も作れます