|
@@ -237,7 +237,7 @@ var BABYLON;
|
|
else if (key === "kd") {
|
|
else if (key === "kd") {
|
|
// Diffuse color (color under white light) using RGB values
|
|
// Diffuse color (color under white light) using RGB values
|
|
//value = "r g b"
|
|
//value = "r g b"
|
|
- color = value.split(delimiter_pattern, 3);
|
|
|
|
|
|
+ color = value.split(delimiter_pattern, 3).map(parseFloat);
|
|
//color = [r,g,b]
|
|
//color = [r,g,b]
|
|
//Set tghe color into the material
|
|
//Set tghe color into the material
|
|
material.diffuseColor = BABYLON.Color3.FromArray(color);
|
|
material.diffuseColor = BABYLON.Color3.FromArray(color);
|
|
@@ -245,7 +245,7 @@ var BABYLON;
|
|
else if (key === "ka") {
|
|
else if (key === "ka") {
|
|
// Ambient color (color under shadow) using RGB values
|
|
// Ambient color (color under shadow) using RGB values
|
|
//value = "r g b"
|
|
//value = "r g b"
|
|
- color = value.split(delimiter_pattern, 3);
|
|
|
|
|
|
+ color = value.split(delimiter_pattern, 3).map(parseFloat);
|
|
//color = [r,g,b]
|
|
//color = [r,g,b]
|
|
//Set tghe color into the material
|
|
//Set tghe color into the material
|
|
material.ambientColor = BABYLON.Color3.FromArray(color);
|
|
material.ambientColor = BABYLON.Color3.FromArray(color);
|
|
@@ -253,23 +253,23 @@ var BABYLON;
|
|
else if (key === "ks") {
|
|
else if (key === "ks") {
|
|
// Specular color (color when light is reflected from shiny surface) using RGB values
|
|
// Specular color (color when light is reflected from shiny surface) using RGB values
|
|
//value = "r g b"
|
|
//value = "r g b"
|
|
- color = value.split(delimiter_pattern, 3);
|
|
|
|
|
|
+ color = value.split(delimiter_pattern, 3).map(parseFloat);
|
|
//color = [r,g,b]
|
|
//color = [r,g,b]
|
|
//Set the color into the material
|
|
//Set the color into the material
|
|
material.specularColor = BABYLON.Color3.FromArray(color);
|
|
material.specularColor = BABYLON.Color3.FromArray(color);
|
|
}
|
|
}
|
|
else if (key === "ke") {
|
|
else if (key === "ke") {
|
|
// Emissive color using RGB values
|
|
// Emissive color using RGB values
|
|
- color = value.split(delimiter_pattern, 3);
|
|
|
|
|
|
+ color = value.split(delimiter_pattern, 3).map(parseFloat);
|
|
material.emissiveColor = BABYLON.Color3.FromArray(color);
|
|
material.emissiveColor = BABYLON.Color3.FromArray(color);
|
|
}
|
|
}
|
|
else if (key === "ns") {
|
|
else if (key === "ns") {
|
|
//value = "Integer"
|
|
//value = "Integer"
|
|
- material.specularPower = value;
|
|
|
|
|
|
+ material.specularPower = parseFloat(value);
|
|
}
|
|
}
|
|
else if (key === "d") {
|
|
else if (key === "d") {
|
|
//d is dissolve for current material. It mean alpha for BABYLON
|
|
//d is dissolve for current material. It mean alpha for BABYLON
|
|
- material.alpha = value;
|
|
|
|
|
|
+ material.alpha = parseFloat(value);
|
|
//Texture
|
|
//Texture
|
|
//This part can be improved by adding the possible options of texture
|
|
//This part can be improved by adding the possible options of texture
|
|
}
|
|
}
|