visgl / deck.gl

WebGL2 powered visualization framework
https://deck.gl
MIT License
12.2k stars 2.09k forks source link

[Bug]SimpleMeshLayer adding FillStyleExtension is invalid #7622

Closed ranranbyte closed 1 year ago

ranranbyte commented 1 year ago

Description

const layer = new SimpleMeshLayer({ id: 'trafficSignLayer', data: this.trafficSignData, coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS, coordinateOrigin: this.trackPosition,

        getColor: d => [256, 256, 256],
        getOrientation: d => d.orientation === '+' ? [0, d.hdg * 180, 90] : [0, -d.hdg * 180, 90],
        getPosition: d => d.position,
        mesh: './../../data/trafficSign.obj',
        sizeScale: 0.08,
        fillPatternAtlas: './../../data/texture/bus-sign.png',
        fillPatternMapping: './../../data/texture/bus-sign.json',
        getFillPattern: d => 'direct-right-sign',
        getFillPatternScale: 1,
        getFillPatternOffset: [0, 0],

        extensions: [new FillStyleExtension({ pattern: true })],
        loaders: [OBJLoader],
        pickable: true
    });

Flavors

Expected Behavior

SimpleMeshLayer texture can be displayed normally

Steps to Reproduce

Add a SimpleMeshLayer and then add the FillStyleExtension extension

Environment

Logs

No response

Pessimistress commented 1 year ago

FillStyleExtension does not work with SimpleMeshLayer as the texture is applied on the XY plane. You should use the texture prop of the layer.