Parses diffuse reflectivity: Kd r g b
(fields []string)
| 812 | // Parses diffuse reflectivity: |
| 813 | // Kd r g b |
| 814 | func (dec *Decoder) parseKd(fields []string) error { |
| 815 | |
| 816 | if len(fields) < 3 { |
| 817 | return dec.formatError("'Kd' with less than 3 fields") |
| 818 | } |
| 819 | var colors [3]float32 |
| 820 | for pos, f := range fields[:3] { |
| 821 | val, err := strconv.ParseFloat(f, 32) |
| 822 | if err != nil { |
| 823 | return err |
| 824 | } |
| 825 | colors[pos] = float32(val) |
| 826 | } |
| 827 | dec.matCurrent.Diffuse.Set(colors[0], colors[1], colors[2]) |
| 828 | return nil |
| 829 | } |
| 830 | |
| 831 | // Parses emissive color: |
| 832 | // Ke r g b |
no test coverage detected