text: [{"Owner":"8Observer8","Date":"2017-01-22T14:07:13Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tHello_lt_br /_gt__lt_br /_gt_\n\tI want to run _lt_a href_eq__qt_http_dd_//doc.babylonjs.com/_qt_ rel_eq__qt_external nofollow_qt__gt_Getting Started Example_lt_/a_gt_ in TypeScript on JSFiddle_dd_ _lt_a href_eq__qt_https_dd_//jsfiddle.net/8Observer8/z4vo5u5d/68/_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//jsfiddle.net/8Observer8/z4vo5u5d/68/_lt_/a_gt__lt_br /_gt__lt_br /_gt_\n\tBut an error occurs on the line 50 _qt_this._scene.render()_sm__qt_\n_lt_/p_gt_\n\n_lt_blockquote class_eq__qt_ipsQuote_qt_ data-ipsquote_eq__qt__qt__gt_\n\t_lt_div class_eq__qt_ipsQuote_citation_qt__gt_\n\t\tQuote\n\t_lt_/div_gt_\n\n\t_lt_div class_eq__qt_ipsQuote_contents_qt__gt_\n\t\t_lt_p_gt_\n\t\t\tUncaught TypeError_dd_ Cannot read property _t__scene_t_ of undefined\n\t\t_lt_/p_gt_\n\t_lt_/div_gt_\n_lt_/blockquote_gt_\n\n_lt_p_gt_\n\tThank you in advance\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"8Observer8","Date":"2017-01-22T21:25:21Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tNow it works_dd_ _lt_a href_eq__qt_https_dd_//jsfiddle.net/8Observer8/z4vo5u5d/75/_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//jsfiddle.net/8Observer8/z4vo5u5d/75/_lt_/a_gt__lt_br /_gt__lt_br /_gt_\n\tI added _lt_strong_gt__lt_span style_eq__qt_color_dd_#ff0000_sm__qt__gt_var self _eq_ this_sm__lt_/span_gt_ _lt_/strong_gt_in animate() method_dd_\n_lt_/p_gt_\n\n_lt_pre_gt_\n_lt_code_gt_    animate() _dd_ void\n    {\n        var self _eq_ this_sm_\n\n        // run the render loop\n        this._engine.runRenderLoop(() _eq_&gt_sm_\n        {\n            self._scene.render()_sm_\n        })_sm_\n\n        // the canvas/window resize event handler\n        window.addEventListener(_t_resize_t__co_ () _eq_&gt_sm_\n        {\n            self._engine.resize()_sm_\n        })_sm_\n    }\n_lt_/code_gt__lt_/pre_gt_\n\n_lt_p_gt_\n\tThis is the completed code_dd_\n_lt_/p_gt_\n\n_lt_pre_gt_\n_lt_code_gt_&lt_sm_canvas id_eq__qt_renderCanvas_qt_&gt_sm_&lt_sm_/canvas&gt_sm_\n\n&lt_sm_script src_eq__qt_https_dd_//cdnjs.cloudflare.com/ajax/libs/babylonjs/2.3.0/babylon.js_qt_&gt_sm_&lt_sm_/script&gt_sm__lt_/code_gt__lt_/pre_gt_\n\n_lt_pre_gt_\n_lt_code_gt_    html_co_ body {\n        overflow_dd_ hidden_sm_\n        width   _dd_ 100%_sm_\n        height  _dd_ 100%_sm_\n        margin  _dd_ 0_sm_\n        padding _dd_ 0_sm_\n    }\n\n    #renderCanvas {\n        width   _dd_ 100%_sm_\n        height  _dd_ 100%_sm_\n        touch-action_dd_ none_sm_\n    }_lt_/code_gt__lt_/pre_gt_\n\n_lt_pre_gt_\n_lt_code_gt_class Game\n{\n    private _canvas_dd_ HTMLCanvasElement_sm_\n    private _engine_dd_ BABYLON.Engine_sm_\n    private _scene_dd_ BABYLON.Scene_sm_\n    private _camera_dd_ BABYLON.FreeCamera_sm_\n    private _light_dd_ BABYLON.Light_sm_\n  \n    constructor(canvasElement _dd_ string)\n    {\n        // Create canvas and engine\n        this._canvas _eq_ document.getElementById(canvasElement)_sm_\n        this._engine _eq_ new BABYLON.Engine(this._canvas_co_ true)_sm_\n    }\n\n    createScene() _dd_ void\n    {\n        // create a basic BJS Scene object\n        this._scene _eq_ new BABYLON.Scene(this._engine)_sm_\n        \n        // create a FreeCamera_co_ and set its position to (x_dd_0_co_ y_dd_5_co_ z_dd_-10)\n        this._camera _eq_ new BABYLON.FreeCamera(_t_camera1_t__co_ new BABYLON.Vector3(0_co_ 5_co_-10)_co_ this._scene)_sm_\n        \n        // target the camera to scene origin\n        this._camera.setTarget(BABYLON.Vector3.Zero())_sm_\n\n        // attach the camera to the canvas\n        this._camera.attachControl(this._canvas_co_ false)_sm_\n\n        // create a basic light_co_ aiming 0_co_1_co_0 - meaning_co_ to the sky\n        this._light _eq_ new BABYLON.HemisphericLight(_t_light1_t__co_ new BABYLON.Vector3(0_co_1_co_0)_co_ this._scene)_sm_\n\n        // create a built-in _qt_sphere_qt_ shape_sm_ with 16 segments and diameter of 2\n        let sphere _eq_ BABYLON.MeshBuilder.CreateSphere(_t_sphere1_t__co_\n                            {segments_dd_ 16_co_ diameter_dd_ 2}_co_ this._scene)_sm_\n\n        // move the sphere upward 1/2 of its height\n        sphere.position.y _eq_ 1_sm_\n\n        // create a built-in _qt_ground_qt_ shape\n        let ground _eq_ BABYLON.MeshBuilder.CreateGround(_t_ground1_t__co_\n                            {width_dd_ 6_co_ height_dd_ 6_co_ subdivisions_dd_ 2}_co_ this._scene)_sm_\n    }\n\n    animate() _dd_ void\n    {\n        var self _eq_ this_sm_\n        // run the render loop\n        this._engine.runRenderLoop(() _eq_&gt_sm_\n        {\n            self._scene.render()_sm_\n        })_sm_\n\n        // the canvas/window resize event handler\n        window.addEventListener(_t_resize_t__co_ () _eq_&gt_sm_\n        {\n            self._engine.resize()_sm_\n        })_sm_\n    }\n}\n\nwindow.addEventListener(_t_DOMContentLoaded_t__co_ () _eq_&gt_sm_\n{\n    // Create the game using the _t_renderCanvas_t_\n    let game _eq_ new Game(_t_renderCanvas_t_)_sm_\n\n    // Create the scene\n    game.createScene()_sm_\n\n    // start animation\n    game.animate()_sm_\n})_sm__lt_/code_gt__lt_/pre_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"8Observer8","Date":"2017-06-08T22:01:15Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tIt works on codepen too_dd_ _lt_a href_eq__qt_https_dd_//codepen.io/8Observer8/pen/XgXJvR_qt_ rel_eq__qt_external nofollow_qt__gt_Getting Started Example in TypeScript_lt_/a_gt_\n_lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"}]