The viewer library exposes the Viewer
type and you can instantiate it like below:
const viewer = new Viewer(container: HTMLElement, params: ViewerParams)
container
: the HTML element you want to attach the viewer toparams
: ViewerParamsinterface ViewerParams {
showStats: boolean
environmentSrc: Asset | string
verbose: boolean
}
showStats
: Enables/Disabled the stats window at the top left of the viewer canvasenvironmentSrc
: Allows for user defined environment texture for the viewer Scene in the form of a equirectangular HDRIverbose
: Displays additional information and warning in the console.export enum AssetType {
TEXTURE_8BPP = 'png', // For now
TEXTURE_HDR = 'hdr',
TEXTURE_EXR = 'exr'
}
export interface Asset {
src: string
type: AssetType
}