Merge branch 'dev' into ifcimporter
This commit is contained in:
commit
855ba95d66
@ -269,20 +269,15 @@ OV.ImporterPly = class extends OV.ImporterBase
|
|||||||
|
|
||||||
function GetMaterialFromColor (obj, color, colorToMaterial)
|
function GetMaterialFromColor (obj, color, colorToMaterial)
|
||||||
{
|
{
|
||||||
function IntegerToHex (intVal)
|
|
||||||
{
|
|
||||||
let result = parseInt (intVal, 10).toString (16);
|
|
||||||
while (result.length < 2) {
|
|
||||||
result = '0' + result;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (color === null) {
|
if (color === null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let materialName = 'Color ' + IntegerToHex (color[0]) + IntegerToHex (color[1]) + IntegerToHex (color[2]) + IntegerToHex (color[3]);
|
let materialName = 'Color ' +
|
||||||
|
OV.IntegerToHexString (color[0]) +
|
||||||
|
OV.IntegerToHexString (color[1]) +
|
||||||
|
OV.IntegerToHexString (color[2]) +
|
||||||
|
OV.IntegerToHexString (color[3]);
|
||||||
let materialIndex = colorToMaterial[materialName];
|
let materialIndex = colorToMaterial[materialName];
|
||||||
if (materialIndex === undefined) {
|
if (materialIndex === undefined) {
|
||||||
let material = new OV.Material ();
|
let material = new OV.Material ();
|
||||||
|
|||||||
@ -162,20 +162,20 @@ OV.LinearToSRGB = function (component)
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
OV.IntegerToHexString = function (intVal)
|
||||||
|
{
|
||||||
|
let result = parseInt (intVal, 10).toString (16);
|
||||||
|
while (result.length < 2) {
|
||||||
|
result = '0' + result;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
OV.ColorToHexString = function (color)
|
OV.ColorToHexString = function (color)
|
||||||
{
|
{
|
||||||
function IntegerToHex (intVal)
|
let r = OV.IntegerToHexString (color.r);
|
||||||
{
|
let g = OV.IntegerToHexString (color.g);
|
||||||
let result = parseInt (intVal, 10).toString (16);
|
let b = OV.IntegerToHexString (color.b);
|
||||||
while (result.length < 2) {
|
|
||||||
result = '0' + result;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
let r = IntegerToHex (color.r);
|
|
||||||
let g = IntegerToHex (color.g);
|
|
||||||
let b = IntegerToHex (color.b);
|
|
||||||
return r + g + b;
|
return r + g + b;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user