Add helper function for color conversion.
This commit is contained in:
parent
5c40815a7d
commit
53d30d0b64
@ -68,7 +68,7 @@ OV.ThreeModelLoader = class
|
||||
ReplaceDefaultMaterialColor (defaultColor)
|
||||
{
|
||||
if (this.defaultMaterial !== null) {
|
||||
this.defaultMaterial.color = new THREE.Color (defaultColor.r / 255.0, defaultColor.g / 255.0, defaultColor.b / 255.0);
|
||||
this.defaultMaterial.color = OV.ConvertColorToThreeColor (defaultColor);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -91,11 +91,8 @@ OV.ViewerGeometry = class
|
||||
this.ClearMainEdgeObject ();
|
||||
this.GenerateMainEdgeObject ();
|
||||
} else {
|
||||
let edgeColor = new THREE.Color (
|
||||
this.edgeSettings.edgeColor.r / 255.0,
|
||||
this.edgeSettings.edgeColor.g / 255.0,
|
||||
this.edgeSettings.edgeColor.b / 255.0
|
||||
);
|
||||
|
||||
let edgeColor = OV.ConvertColorToThreeColor (this.edgeSettings.edgeColor);
|
||||
this.EnumerateEdges ((edge) => {
|
||||
edge.material.color = edgeColor;
|
||||
});
|
||||
@ -168,11 +165,7 @@ OV.ViewerGeometry = class
|
||||
|
||||
GenerateMainEdgeObject ()
|
||||
{
|
||||
let edgeColor = new THREE.Color (
|
||||
this.edgeSettings.edgeColor.r / 255.0,
|
||||
this.edgeSettings.edgeColor.g / 255.0,
|
||||
this.edgeSettings.edgeColor.b / 255.0
|
||||
);
|
||||
let edgeColor = OV.ConvertColorToThreeColor (this.edgeSettings.edgeColor);
|
||||
this.mainEdgeObject = new THREE.Object3D ();
|
||||
|
||||
this.UpdateWorldMatrix ();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user