Ncurses Render Engine Tutorial: pt 10 (Model Loading & Rendering!)

Опубликовано: 03 Февраль 2021
на канале: KayOS Code
811
28

In this tutorial, I go over the OBJ file format and write the code for how to load models from that format and render them!


MINOR BUG ALERT: Some complicated models will refuse to render with the code as it's setup. I have fix for the next tutorial which I will publish very soon

github: https://github.com/youngbrycecode
--MODELS UNDER TUTORIAL10/res--


Chapters:
0:00 Introduction
0:24 Blender Models
1:07 Obj File Format
5:23 Implementation
35:45 Conclusion

Casual Coder:    / pivotofpower  


OBJ file format reference:
#comments are ignored
'v ' indicates a vertex where three floats follow on the same line
'vt' indicates a texture coordinate where two floats follow
'vn' indicates a normal where three floats follow
'f ' indicates a face and connects three vertices to draw a triangle

Model loading process:
1. Load the file contents line by line
2. Load all positions, texture coords, and normals
3. Load each face and create unique vertices from that data - store in an efficient data structure such as an unordered set
4. Store an index for each unique vertex and store in the index list a pointer to it's correct vertex
5. There are three positions for every index, three normals, and two texture coordinates
6. Loop through each vertex in the set and write to the correct locations in the array the REAL values of the positions, normals, and texture coords
7. When rendering, loop through the model's indices in groups of three and draw triangles between the points - interpolate between the data points!


На этой странице сайта вы можете посмотреть видео онлайн Ncurses Render Engine Tutorial: pt 10 (Model Loading & Rendering!) длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь KayOS Code 03 Февраль 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 811 раз и оно понравилось 28 зрителям. Приятного просмотра!