var start = { x: 0, y: 0, z: 0 };
var segments = 3;
var width = 0;
var widthInc = 0.2;
var height = 0;
var heightInc = 0.4;
var depth = 0;
var depthInc = 0.4;
var pointer = { x: 0, y: 0, z: 0 };
var positions = Array();
var i = 0;
while(i < 100){
positions.push({ x: pointer.x, y: pointer.y, z: pointer.z });
positions.push({ x: pointer.x-widthInc, y: pointer.y+heightInc, z: pointer.z+depthInc } );
positions.push({ x: pointer.x, y: pointer.y+heightInc, z: pointer.z+depthInc } );
positions.push({ x: pointer.x, y: pointer.y, z: pointer.z });
positions.push({ x: pointer.x+widthInc, y: pointer.y+heightInc, z: pointer.z+depthInc } );
positions.push({ x: pointer.x, y: pointer.y+heightInc, z: pointer.z+depthInc } );
pointer.y+=heightInc;
i++;
}
console.log(positions);
var canvas = document.getElementById("renderCanvas"); // Get the canvas element
var engine = new BABYLON.Engine(canvas, true); // Generate the BABYLON 3D
var createScene = function () {
// Create the scene space
var scene = new BABYLON.Scene(engine);
scene.clearColor = new BABYLON.Color3(0,0,0);
// Add a camera to the scene and attach it to the canvas
var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI / 2, Math.PI / 2, 2, BABYLON.Vector3.Zero(), scene);
camera.attachControl(canvas, true);
// Add lights to the scene
var light2 = new BABYLON.PointLight("light2", new BABYLON.Vector3(0, 1, -1), scene);
// This is where you create and manipulate meshes
var mesh_1 = new BABYLON.MeshBuilder.CreateTube("tube", { path: Array( new BABYLON.Vector3(5, 0, 0),new BABYLON.Vector3(0, 1, 0.1),new BABYLON.Vector3(-4, 6, 0.2)), radius: 0.1, tessellation: 4, arc: 1 }, scene);
mesh_1.position = new BABYLON.Vector3(0,0,0);
mesh_1.rotation = new BABYLON.Vector3(0,0,0);
mesh_1.scaling = new BABYLON.Vector3(1,1,1);
mesh_1.isVisible = true;
mesh_1.id = "tube";
return scene;
};
createScene();
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.