Parses a vertex position line v [w]
(fields []string)
| 507 | // Parses a vertex position line |
| 508 | // v <x> <y> <z> [w] |
| 509 | func (dec *Decoder) parseVertex(fields []string) error { |
| 510 | |
| 511 | if len(fields) < 3 { |
| 512 | return errors.New("Less than 3 vertices in 'v' line") |
| 513 | } |
| 514 | for _, f := range fields[:3] { |
| 515 | val, err := strconv.ParseFloat(f, 32) |
| 516 | if err != nil { |
| 517 | return err |
| 518 | } |
| 519 | dec.Vertices.Append(float32(val)) |
| 520 | } |
| 521 | return nil |
| 522 | } |
| 523 | |
| 524 | // Parses a vertex normal line |
| 525 | // vn <x> <y> <z> |