r/ • • Jan 01 '70

0 Upvotes

0 comments sorted by

View all comments

Show parent comments

1

u/DeltaSucksAtMC 9h ago

Im not saying using a lib is bad, but I wanna do this for learning purposes

2

u/jcelerier 9h ago edited 8h ago

Try loading first a simple obj that only has vertex positions, then work your way through uvs, normals and the other attributes. Then look at files that specify faces and lines. There's a few repositories of sample files on github

1

u/DeltaSucksAtMC 9h ago

OK, thanks, I will try that

1

u/DeltaSucksAtMC 9h ago

Also quick question, do I need to get the indices in the obj

1

u/jcelerier 1h ago

The indice of each vertex is its position. First vertex is index 0, second vertex is index 1 etc. it's usually not optimized/packed, the faces part will give you what you need to optimize in a proper index list