How to use the @here/harp-materials.IconMaterial function in @here/harp-materials

To help you get started, we’ve selected a few @here/harp-materials 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 heremaps / harp.gl / @here / harp-mapview / lib / poi / PoiRenderer.ts View on Github external
const iconTexture = new IconTexture(this.imageItem);
        const texture = new THREE.Texture(
            iconTexture.image.imageData as any,
            THREE.UVMapping,
            undefined,
            undefined,
            bilinear ? THREE.LinearFilter : THREE.NearestFilter,
            bilinear ? THREE.LinearFilter : THREE.NearestFilter,
            THREE.RGBAFormat
        );
        texture.needsUpdate = true;
        texture.premultiplyAlpha = premultipliedAlpha;
        texture.generateMipmaps = false; // not needed, always rendered in full size

        this.m_material = new IconMaterial({
            map: texture
        });

        this.boxBuffer = new BoxBuffer(this.m_material, this.renderOrder);

        const mesh = this.boxBuffer.mesh;

        mesh.frustumCulled = false;

        this.scene.add(mesh);

        this.mapView.update();
    }
}