Class: SceneLoader

SceneLoader(containerIn) → {SceneLoader}

new SceneLoader(containerIn) → {SceneLoader}

A helper class to help with reading / importing primitives and settings into a Scene.
Parameters:
Name Type Description
containerIn Object Container to create the renderer on.
Author:
  • Alan Wu
Source:
Returns:
Type
SceneLoader

Methods

getDownloadProgress() → {Array}

This function returns a three component array, which contains [totalsize, totalLoaded and errorDownload] of all the downloads happening in this scene.
Source:
Returns:
Type
Array

loadFromViewURL(URL)

Load a legacy file format containing the viewport and its meta file from an external location provided by the url. Use the new metadata format with Zinc.SceneLoader.#loadMetadataURL instead.
Parameters:
Name Type Description
URL String address to the file containing viewport and model information.
Deprecated:
  • Yes
Source:

loadGLTF(url, finishCallback)

Load GLTF into this scene object.
Parameters:
Name Type Description
url String URL to the GLTF file
finishCallback function Callback function which will be called once the glyphset is succssfully load in.
Source:

loadGlyphsetURL(metaurl, glyphurl, groupName, finishCallback)

Load a glyphset into this scene object.
Parameters:
Name Type Description
metaurl String Provide informations such as transformations, colours and others for each of the glyph in the glyphsset.
glyphurl String regular json model file providing geometry of the glyph.
groupName String name to assign the glyphset's groupname to.
finishCallback function Callback function which will be called once the glyphset is succssfully load in.
Source:

loadLinesURL(timeEnabled, morphColour, groupName, finishCallback)

Load lines into this scene object.
Parameters:
Name Type Description
timeEnabled Boolean Indicate if morphing is enabled.
morphColour Boolean Indicate if color morphing is enabled.
groupName STRING name to assign the pointset's groupname to.
finishCallback function Callback function which will be called once the glyphset is succssfully load in.
Source:

loadMetadataURL(url, finishCallback)

Load a metadata file from the provided URL into this scene. Once succssful scene proceeds to read each items into scene for visualisations.
Parameters:
Name Type Description
url String Location of the metafile
finishCallback function Callback function which will be called for each glyphset and geometry that has been written in.
Source:

loadModelsURL()

Load a legacy model(s) format with the provided URLs and parameters. This only loads the geometry without any of the metadata. Therefore, extra parameters should be provided.
Deprecated:
  • Yes
Source:

loadOBJ(url, groupName, finishCallback)

Read a OBJ file into this scene, the geometry will be presented as Zinc.Geometry.
Parameters:
Name Type Description
url STRING location to the STL file.
groupName STRING name to assign the geometry's groupname to.
finishCallback function Callback function which will be called once the OBJ geometry is succssfully loaded.
Source:

loadPointsetURL(timeEnabled, morphColour, groupName, finishCallback)

Load a pointset into this scene object.
Parameters:
Name Type Description
timeEnabled Boolean Indicate if morphing is enabled.
morphColour Boolean Indicate if color morphing is enabled.
groupName STRING name to assign the pointset's groupname to.
finishCallback function Callback function which will be called once the glyphset is succssfully load in.
Source:

loadSTL(url, groupName, finishCallback)

Read a STL file into this scene, the geometry will be presented as Zinc.Geometry.
Parameters:
Name Type Description
url STRING location to the STL file.
groupName STRING name to assign the geometry's groupname to.
finishCallback function Callback function which will be called once the STL geometry is succssfully loaded.
Source:

loadTextureURL(groupName, finishCallback)

Load a texture into this scene object.
Parameters:
Name Type Description
groupName STRING name to assign the pointset's groupname to.
finishCallback function Callback function which will be called once the glyphset is succssfully load in.
Source:

loadViewURL(URL)

Load the viewport from an external location provided by the url.
Parameters:
Name Type Description
URL String address to the file containing viewport information.
Source:

(inner) addZincGeometry(geometry, color, opacity, localTimeEnabled, localMorphColour, external, finishCallback, materialIn) → {Zinc.Geometry}

Add a user provided {THREE.Geometry} into the scene as zinc geometry.
Parameters:
Name Type Description
geometry Three.Geometry The threejs geometry to be added as Zinc.Geometry.
color THREE.Color Colour to be assigned to this geometry, overrided if materialIn is provided.
opacity Number Opacity to be set for this geometry, overrided if materialIn is provided.
localTimeEnabled Boolean Set this to true if morph geometry is present, overrided if materialIn is provided.
localMorphColour Boolean Set this to true if morph colour is present, overrided if materialIn is provided.
external Boolean Set this to true if morph geometry is present, overrided if materialIn is provided.
finishCallback function Callback once the geometry has been added succssfully.
materialIn THREE.Material Material to be set for this geometry if it is present.
Source:
Returns:
Type
Zinc.Geometry

(inner) loadSurfaceURL(url, timeEnabled, morphColour, groupName, fileFormat, finishCallback)

Load a geometry into this scene, this is a subsequent called from Zinc.Scene#loadMetadataURL, although it can be used to read in geometry into the scene externally.
Parameters:
Name Type Description
url String regular json model file providing geometry.
timeEnabled Boolean Indicate if geometry morphing is enabled.
morphColour Boolean Indicate if color morphing is enabled.
groupName STRING name to assign the geometry's groupname to.
fileFormat STRING name supported formats are STL, OBJ and JSON.
finishCallback function Callback function which will be called once the geometry is succssfully loaded in.
Source: