Transparency handling.
This commit is contained in:
parent
855ba95d66
commit
e416aae4bc
10
source/external/ifcimporter.js
vendored
10
source/external/ifcimporter.js
vendored
@ -120,12 +120,20 @@ OV.ImporterIfc = class extends OV.ImporterBase
|
|||||||
parseInt (ifcColor.y * 255.0, 10),
|
parseInt (ifcColor.y * 255.0, 10),
|
||||||
parseInt (ifcColor.z * 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];
|
let materialIndex = this.materialNameToIndex[materialName];
|
||||||
if (materialIndex === undefined) {
|
if (materialIndex === undefined) {
|
||||||
let material = new OV.Material ();
|
let material = new OV.Material ();
|
||||||
material.name = materialName;
|
material.name = materialName;
|
||||||
material.diffuse = color;
|
material.diffuse = color;
|
||||||
|
material.opacity = ifcColor.w;
|
||||||
|
OV.UpdateMaterialTransparency (material);
|
||||||
materialIndex = this.model.AddMaterial (material);
|
materialIndex = this.model.AddMaterial (material);
|
||||||
this.materialNameToIndex[materialName] = materialIndex;
|
this.materialNameToIndex[materialName] = materialIndex;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user