ModelPreviews beta
Class of @v12-engine/client/lite-views
export declare class ModelPreviewsSmall pictures of models, for choosing between them, like the kinds of tree in the editor: each stood alone in a side view of the renderer, drawn once and read back, one at a time, and kept
Members
constructor
constructor(renderer: Renderer, size?: number,
assets?: SceneryAssets);Constructs a new instance of the ModelPreviews class
dispose
dispose(): void;Takes the previews' stages, their turning models and their models' files away
fileImage
fileImage(url: string): Promise<string>;A picture of a model file as it is, by its address, as a data URL
image
image(model: PreviewModel): Promise<string>;A picture of the model as a data URL
info
info(url: string): Promise<ModelInfo>;What there is in a model file: its triangles, meshes and bones, its animations by name, how big it is made
pixels
pixels(model: PreviewModel, shot: PreviewShot): Promise<ImageData>;The pixels of a shot of a model: the picture's rows from the top, four bytes a pixel. Taken in its turn
spin
spin(canvas: HTMLCanvasElement, model: PreviewModel, options?: {
speed?: number;
every?: number;
shot?: PreviewShot;
}): Promise<SpunPreview>;A model turning in a canvas of the page, at the canvas's own size: drawn straight onto it, every every frames of the renderer (1: each), until stop