User Manual Developer Reference Extras Extras / Core Extras / Curves Extras / Objects Examples Misc App
App class allows you to set up your 3D application more easily. It
includes code to init WebGL renderer, load glTF scenes, auto-start
animations as well as logic for basic camera controls.
App(container, ctxSettings, preloader)
container - the id of an HTML-element or the HTML-element itself to contain the canvas.
- the WebGL context attributes to be passed in the 'canvas.getContext()' method.
- the application's Preloader.
Set the scene background to
null after loading a gltf scene. Default is false.
A container element. This is a parent element for 3D Canvas used for rendering operations.
Application main scene.
Application main camera.
Application clock object.
Application main camera controls object.
Mixer used to play animations loaded from glTF data.
App preloader element (exists only during scene loading)
Application WebGL renderer.
Application glTF loader.
Resolution of the cubemap texture represeinting the world material. Default is 1024.
Handler for scene updates: rendering, animations and camera controls. Do not change unless you know what you are doing.
Unload scene and clean up application data.
Enable controls for the main app camera. Depending on the control type specified for the camera this method will give you 'ORBIT', 'FLYING' or static camera.
Returns main app camera.
Return calculated container element height.
Return calculated container element width.
Handler for app post-processing initialization. Do not change unless you know what you are doing.
# . load (url, loadOkCb, loadErrorCb, autoStart) : null
Load the glTF scene.
Handler for canvas resize event. Do not change unless you know what you are doing.
Handler for scene rendering. Do not change unless you know what you are doing.
# . run () : null
Starts the application by removing the preloader and starting the
For more info on how to obtain the source code of this module see