Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

problem with sprites icon rendering #3

@casper5822

Description

@casper5822

Hello, i have a problem with icon url for sprites.
I have different icons for each sprite, the images are png 512x512px and they are passed as base64 encoded string images.

This is my code:

`
let viewableData = new Autodesk.DataVisualization.Core.ViewableData({
atlasWidth: 512,
atlasHeight: 512
});
viewableData.spriteSize = 36;

  for(var i = 0; i < this.sensors.length;i++){
    let sensor = this.sensors[i];
    const style = new Autodesk.DataVisualization.Core.ViewableStyle(Autodesk.DataVisualization.Core.ViewableType.SPRITE, new THREE.Color(0xffffff), sensor.img);
    const viewable = new Autodesk.DataVisualization.Core.SpriteViewable(new THREE.Vector3(sensor.x,sensor.y,sensor.z), style, sensor.dbId);
    viewableData.addViewable(viewable);
  }

  viewableData.finish()
  .then(()=>{
      this.dataVizExtn.addViewables(viewableData);
  },error =>{
    console.log(error)
  });`

I have 7 sensors and there is a problem with the last sensor because all the previous sprites show the wrong image (they show the latest sensor icon).
How this can be possible?

Other info:
Angular 11 app
wrapper: "ng2-adsk-forge-viewer": "^1.4.0"

Thank you.

screencapture-localhost-4200-viewer-2021-11-22-17_48_35

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions