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