How to use the webgl-operate.Canvas function in webgl-operate

To help you get started, we’ve selected a few webgl-operate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cginternals / webgl-operate / demos / point-cloud / point-cloud.ts View on Github external
initialize(element: HTMLCanvasElement | string): boolean {

        const alpha2coverage = auxiliaries.GETparameter('alpha2coverage');

        this._canvas = new Canvas(element, {
            antialias: alpha2coverage === undefined ? false : JSON.parse(alpha2coverage!),
        });
        this._canvas.controller.multiFrameNumber = 1;
        this._canvas.framePrecision = Wizard.Precision.byte;
        this._canvas.frameScale = [1.0, 1.0];

        this._renderer = new PointCloudRenderer();
        this._canvas.renderer = this._renderer;


        const input = document.getElementById('input-file')! as HTMLInputElement;
        // const label = document.getElementById('label-file')! as HTMLLabelElement;
        input.addEventListener('change', () => {
            importPointsFromCSV(input.files!).then(result => console.log(result));
        });
github cginternals / webgl-operate / examples / label3d-example.ts View on Github external
initialize(element: HTMLCanvasElement | string): boolean {

        this._canvas = new Canvas(element, { antialias: false });
        this._canvas.controller.multiFrameNumber = 1;
        this._canvas.framePrecision = Wizard.Precision.byte;
        this._canvas.frameScale = [1.0, 1.0];

        this._renderer = new Label3DRenderer();
        this._canvas.renderer = this._renderer;

        // Create a target cross as reference for coordinate origin [0,0,0]

        const hlStyle = 'z-index: 1; position: absolute; width: 100%; margin: 0; margin-left: 0%;'
            + 'border: none; border-bottom: 1pt solid #1c75bc; border-top: 1pt solid #1c75bc;';
        const vlStyle = 'z-index: 1; position: absolute; height: 100%; margin: 0; margin-top: 0%;'
            + 'border: none; border-left: 1pt solid #1cbc75; border-right: 1pt solid #1cbc75;';

        const hl = document.createElement('hl');
        hl.setAttribute('style', `${hlStyle} top: 50%;`);
github cginternals / webgl-operate / examples / canvassize-example.ts View on Github external
initialize(element: HTMLCanvasElement | string): boolean {

        this._canvas = new Canvas(element, { antialias: false });
        this._canvas.controller.multiFrameNumber = 1;
        this._canvas.framePrecision = Wizard.Precision.byte;
        this._canvas.frameScale = [1.0, 1.0];

        this._renderer = new CanvasSizeRenderer();
        this._canvas.renderer = this._renderer;

        return true;
    }
github cginternals / webgl-operate / examples / tiled-rendering-example.ts View on Github external
initialize(element: HTMLCanvasElement | string): boolean {

        this._canvas = new Canvas(element, { antialias: false });
        this._canvas.controller.multiFrameNumber = 1;
        this._canvas.framePrecision = Wizard.Precision.byte;
        this._canvas.frameScale = [1.0, 1.0];

        this._renderer = new TiledCubeRenderer();
        this._canvas.renderer = this._renderer;

        return true;
    }
github cginternals / webgl-operate / examples / envprojections-example.ts View on Github external
initialize(element: HTMLCanvasElement | string): boolean {

        this._canvas = new Canvas(element, { antialias: false });
        this._canvas.controller.multiFrameNumber = 1;
        this._canvas.framePrecision = Wizard.Precision.byte;
        this._canvas.frameScale = [1.0, 1.0];

        this._renderer = new EnvironmentProjectionRenderer();
        this._canvas.renderer = this._renderer;

        return true;
    }
github cginternals / webgl-operate / examples / labelelide-example.ts View on Github external
initialize(element: HTMLCanvasElement | string): boolean {

        this._canvas = new Canvas(element, { antialias: false });
        this._canvas.controller.multiFrameNumber = 1;
        this._canvas.framePrecision = Wizard.Precision.byte;
        this._canvas.frameScale = [1.0, 1.0];

        this._renderer = new LabelElideRenderer();
        this._canvas.renderer = this._renderer;

        return true;
    }
github cginternals / webgl-operate / demos / shadow-mapping / shadowmapping.ts View on Github external
initialize(element: HTMLCanvasElement | string): boolean {

        this._canvas = new Canvas(element);
        this._canvas.controller.multiFrameNumber = 1;
        this._canvas.framePrecision = Wizard.Precision.float;
        this._canvas.frameScale = [1.0, 1.0];
        this._canvas.clearColor.fromHex('d6d8db');
        this._canvas.controller.multiFrameNumber = 1024;

        this._canvas.element.addEventListener('click', () => { this._canvas.controller.update(); });

        this._renderer = new ShadowMappingRenderer();
        this._canvas.renderer = this._renderer;

        return true;
    }
github cginternals / webgl-operate / examples / shadowmap-example.ts View on Github external
initialize(element: HTMLCanvasElement | string): boolean {

        this._canvas = new Canvas(element);
        this._canvas.controller.multiFrameNumber = 1;
        this._canvas.framePrecision = Wizard.Precision.byte;
        this._canvas.frameScale = [1.0, 1.0];

        this._canvas.clearColor.fromHex('ffffff');

        this._renderer = new ShadowMapRenderer();
        this._canvas.renderer = this._renderer;

        return true;
    }
github cginternals / webgl-operate / demos / gltf-renderer / gltfrenderer.ts View on Github external
initialize(element: HTMLCanvasElement | string): boolean {

        this._canvas = new Canvas(element, { antialias: true });
        this._canvas.controller.multiFrameNumber = 1;
        this._canvas.framePrecision = Wizard.Precision.byte;
        this._canvas.frameScale = [1.0, 1.0];

        this._renderer = new GltfRenderer();
        this._canvas.renderer = this._renderer;

        return true;
    }
github cginternals / webgl-operate / examples / imagebasedlighting-example.ts View on Github external
initialize(element: HTMLCanvasElement | string): boolean {

        this._canvas = new Canvas(element, { antialias: false });
        this._canvas.controller.multiFrameNumber = 1;
        this._canvas.framePrecision = Wizard.Precision.byte;
        this._canvas.frameScale = [1.0, 1.0];

        this._renderer = new ImageBasedLightingRenderer();
        this._canvas.renderer = this._renderer;

        return true;
    }