Parses a vertex normal line vn
(fields []string)
| 524 | // Parses a vertex normal line |
| 525 | // vn <x> <y> <z> |
| 526 | func (dec *Decoder) parseNormal(fields []string) error { |
| 527 | |
| 528 | if len(fields) < 3 { |
| 529 | return errors.New("Less than 3 normals in 'vn' line") |
| 530 | } |
| 531 | for _, f := range fields[:3] { |
| 532 | val, err := strconv.ParseFloat(f, 32) |
| 533 | if err != nil { |
| 534 | return err |
| 535 | } |
| 536 | dec.Normals.Append(float32(val)) |
| 537 | } |
| 538 | return nil |
| 539 | } |
| 540 | |
| 541 | // Parses a vertex texture coordinate line: |
| 542 | // vt <u> <v> <w> |