parse kd
| 201 | |
| 202 | // parse kd |
| 203 | bool Object::parse_diffuse_color(const std::string &line, Vec3 ¤t_diffuse) |
| 204 | { |
| 205 | std::stringstream ss(line); |
| 206 | |
| 207 | float r, g, b; |
| 208 | if (!(ss >> r >> g >> b)) |
| 209 | { |
| 210 | std::cerr << "error: can't parse diffuse colors" << std::endl; |
| 211 | return false; |
| 212 | } |
| 213 | |
| 214 | current_diffuse = Vec3(r, g, b); |
| 215 | return true; |
| 216 | } |
| 217 | |
| 218 | // methods |
| 219 | bool Object::load(const std::string &obj_filename, bool color_support) |