Transparency handling.

This commit is contained in:
kovacsv 2021-06-13 07:37:11 +02:00
parent 855ba95d66
commit e416aae4bc

View File

@ -120,12 +120,20 @@ OV.ImporterIfc = class extends OV.ImporterBase
parseInt (ifcColor.y * 255.0, 10),
parseInt (ifcColor.z * 255.0, 10)
);
const materialName = 'Color ' + OV.ColorToHexString (color);
const materialName = 'Color ' +
OV.IntegerToHexString (color.r) +
OV.IntegerToHexString (color.g) +
OV.IntegerToHexString (color.b) +
OV.IntegerToHexString (parseInt (ifcColor.w * 255.0, 10));
let materialIndex = this.materialNameToIndex[materialName];
if (materialIndex === undefined) {
let material = new OV.Material ();
material.name = materialName;
material.diffuse = color;
material.opacity = ifcColor.w;
OV.UpdateMaterialTransparency (material);
materialIndex = this.model.AddMaterial (material);
this.materialNameToIndex[materialName] = materialIndex;
}