Parses specular reflectivity: Ks r g b
(fields []string)
| 850 | // Parses specular reflectivity: |
| 851 | // Ks r g b |
| 852 | func (dec *Decoder) parseKs(fields []string) error { |
| 853 | |
| 854 | if len(fields) < 3 { |
| 855 | return dec.formatError("'Ks' with less than 3 fields") |
| 856 | } |
| 857 | var colors [3]float32 |
| 858 | for pos, f := range fields[:3] { |
| 859 | val, err := strconv.ParseFloat(f, 32) |
| 860 | if err != nil { |
| 861 | return err |
| 862 | } |
| 863 | colors[pos] = float32(val) |
| 864 | } |
| 865 | dec.matCurrent.Specular.Set(colors[0], colors[1], colors[2]) |
| 866 | return nil |
| 867 | } |
| 868 | |
| 869 | // Parses optical density, also known as index of refraction |
| 870 | // Ni <optical_density> |
no test coverage detected