Parses a vertex texture coordinate line: vt
(fields []string)
| 541 | // Parses a vertex texture coordinate line: |
| 542 | // vt <u> <v> <w> |
| 543 | func (dec *Decoder) parseTex(fields []string) error { |
| 544 | |
| 545 | if len(fields) < 2 { |
| 546 | return errors.New("Less than 2 texture coords. in 'vt' line") |
| 547 | } |
| 548 | for _, f := range fields[:2] { |
| 549 | val, err := strconv.ParseFloat(f, 32) |
| 550 | if err != nil { |
| 551 | return err |
| 552 | } |
| 553 | dec.Uvs.Append(float32(val)) |
| 554 | } |
| 555 | return nil |
| 556 | } |
| 557 | |
| 558 | // parseFace parses a face decription line: |
| 559 | // f v1[/vt1][/vn1] v2[/vt2][/vn2] v3[/vt3][/vn3] ... |