NasimiAsl Posted July 6, 2018 Share Posted July 6, 2018 @DylanD no body can eat you when you have a T-Rex in your friend list we fix this DylanD 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted July 6, 2018 Share Posted July 6, 2018 start Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted July 6, 2018 Share Posted July 6, 2018 https://www.babylonjs-playground.com/#8AWDVG#11 brianzinn 1 Quote Link to comment Share on other sites More sharing options...
JohnK Posted July 6, 2018 Share Posted July 6, 2018 Badly worded on my part ignore it. You answered my main point thank you. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted July 7, 2018 Share Posted July 7, 2018 On 7/6/2018 at 5:03 AM, brianzinn said: if you wanted some help that is solved this is js we need https://cdn.rawgit.com/NasimiAsl/Extensions/master/ShaderBuilder/tscom.js * notice that too * Copyright (c) Microsoft Corporation. All rights reserved. * monaco-typescript version: 2.0.1(076cc15ec707b6c7a820ae7a16c982af01a35127) * Released under the MIT license * https://github.com/Microsoft/monaco-typescript/blob/master/LICENSE.md that is fully client side and this method compile that triggerCompile(` class Greeter { greeting: string; constructor(message: string) { this.greeting = message; } greet() { return "Hello, " + this.greeting; } } let greeter = new Greeter("world"); `); } and new problem : we need a simple design pattern for make BABYLON Scene from this sample https://www.babylonjs-playground.com/#8AWDVG#11 module: ts.ModuleKind.AMD, target: ts.ScriptTarget.ES5, noLib: true, noResolve: true, suppressOutputPathCheck: true Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted July 8, 2018 Share Posted July 8, 2018 https://github.com/BabylonJS/Babylon.js/pull/4706 PR is created actually it is so cool and so great idea thanks @kentpham88 class SceneBase { scene : any; constructor() { this.scene = new BABYLON.Scene(engine); } } class CameraBase { camera : any; constructor() { this.camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene); this.camera.setTarget(BABYLON.Vector3.Zero()); this.camera.attachControl(canvas, true); } } class SceneTheme { lights : any[]; constructor() { var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene); light.intensity = 0.7; this.lights = new Array(); this.lights.push(light); } } class Objects{ meshes : any[]; constructor(){ this.meshes = new Array(); var sphere = BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene); sphere.position.y = 1; this.meshes.push(sphere); var ground = BABYLON.Mesh.CreateGround("ground1", 6, 6, 2, scene); this.meshes.push(ground); } } class MainScene { constructor() { } CreateScene() { var scene = new SceneBase().scene; var camera = new CameraBase().camera; var theme = new SceneTheme(); var objGroup1 = new Objects(); return scene; } } one of best benefits is created usable class can import in main code with live online debug we never had it before this is like new generation life of babylonjs Wingnut 1 Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 9, 2018 Share Posted July 9, 2018 On 7/8/2018 at 3:11 AM, NasimiAsl said: https://github.com/BabylonJS/Babylon.js/pull/4706 PR is created actually it is so cool and so great idea thanks @kentpham88 class SceneBase { scene : any; constructor() { this.scene = new BABYLON.Scene(engine); } } class CameraBase { camera : any; constructor() { this.camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene); this.camera.setTarget(BABYLON.Vector3.Zero()); this.camera.attachControl(canvas, true); } } class SceneTheme { lights : any[]; constructor() { var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene); light.intensity = 0.7; this.lights = new Array(); this.lights.push(light); } } class Objects{ meshes : any[]; constructor(){ this.meshes = new Array(); var sphere = BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene); sphere.position.y = 1; this.meshes.push(sphere); var ground = BABYLON.Mesh.CreateGround("ground1", 6, 6, 2, scene); this.meshes.push(ground); } } class MainScene { constructor() { } CreateScene() { var scene = new SceneBase().scene; var camera = new CameraBase().camera; var theme = new SceneTheme(); var objGroup1 = new Objects(); return scene; } } one of best benefits is created usable class can import in main code with live online debug we never had it before this is like new generation life of babylonjs Wow great job, so much progress! Quote Link to comment Share on other sites More sharing options...
Guest Posted July 9, 2018 Share Posted July 9, 2018 Thanks a lot @NasimiAsl!! NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.