Parses ambient reflectivity: Ka r g b
(fields []string)
| 793 | // Parses ambient reflectivity: |
| 794 | // Ka r g b |
| 795 | func (dec *Decoder) parseKa(fields []string) error { |
| 796 | |
| 797 | if len(fields) < 3 { |
| 798 | return dec.formatError("'Ka' with less than 3 fields") |
| 799 | } |
| 800 | var colors [3]float32 |
| 801 | for pos, f := range fields[:3] { |
| 802 | val, err := strconv.ParseFloat(f, 32) |
| 803 | if err != nil { |
| 804 | return err |
| 805 | } |
| 806 | colors[pos] = float32(val) |
| 807 | } |
| 808 | dec.matCurrent.Ambient.Set(colors[0], colors[1], colors[2]) |
| 809 | return nil |
| 810 | } |
| 811 | |
| 812 | // Parses diffuse reflectivity: |
| 813 | // Kd r g b |
no test coverage detected