| 185 | |
| 186 | |
| 187 | Vec3f Model::normal(Vec2f uvf) |
| 188 | { |
| 189 | Vec2i uv(uvf[0] * normalmap_.get_width(), uvf[1] * normalmap_.get_height()); |
| 190 | TGAColor c = normalmap_.get(uv[0], uv[1]); |
| 191 | Vec3f res; |
| 192 | for (int i = 0; i < 3; i++) |
| 193 | res[2 - i] = (float)c[i] / 255.f * 2.f - 1.f; |
| 194 | return res; |
| 195 | } |
| 196 | |
| 197 | Vec2f Model::uv(int iface, int nthvert) |
| 198 | { |
no test coverage detected