qqdarren Posted May 12, 2015 Share Posted May 12, 2015 An API design question I've not seen answered, is why the first parameter of just about all the API calls is a name? Is it really needed? The library would be lighter, quicker and all examples would be shorter without it, so is it bringing enough functionality to make it worth that? In all the examples I've seen you end up with not-DRY code like the below (extracted from the Height Map example in the playground): var spot = new BABYLON.SpotLight("spot", ...);var camera = new BABYLON.ArcRotateCamera("Camera", ...);var groundMaterial = new BABYLON.StandardMaterial("ground", scene);var ground = BABYLON.Mesh.CreateGroundFromHeightMap("ground", ...);var sun = BABYLON.Mesh.CreateSphere("sun", 10, 4, scene);sun.material = new BABYLON.StandardMaterial("sun", scene);var skybox = BABYLON.Mesh.CreateBox("skyBox", 800.0, scene);var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene);skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/skybox", scene); Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.