} else {
throw new IncorrectFormatException("Expected material name at line " + tokenizer.lineno());
}
} else if ("Ka".equals(tokenizer.sval)) {
// Read ambient color Ka r g b
Color3f ambiantColor = new Color3f(parseNumber(tokenizer),
parseNumber(tokenizer), parseNumber(tokenizer));
if (currentAppearance != null) {
Material material = getMaterial(currentAppearance);
material.setAmbientColor(ambiantColor);
}
} else if ("Kd".equals(tokenizer.sval)) {
// Read diffuse or emissive color Kd r g b
Color3f diffuseColor = new Color3f(parseNumber(tokenizer),
parseNumber(tokenizer), parseNumber(tokenizer));
if (currentAppearance != null) {
OBJMaterial material = getMaterial(currentAppearance);
material.setDiffuseColor(diffuseColor);
currentAppearance.setColoringAttributes(
new ColoringAttributes(diffuseColor, ColoringAttributes.SHADE_GOURAUD));
}
} else if ("Ks".equals(tokenizer.sval)) {
// Read specular color Ks r g b
Color3f specularColor = new Color3f(parseNumber(tokenizer),
parseNumber(tokenizer), parseNumber(tokenizer));
if (currentAppearance != null) {
OBJMaterial material = getMaterial(currentAppearance);
if (!material.isIlluminationModelSet()
|| material.getIlluminationModel() >= 2) {