Rasterizer Project - Part 4: Triceratops Wireframe
dev.to·15h·
Discuss: DEV
Flag this post

Okay so its time to define our model class both its .h file and cpp file. Lets start with the .h file.

First lets define a vector list made of of different vec3 that our model consists of and then lets.

Then we store each face inside the int list. What is a face? Well every 3 vertexpositions we can draw a triangle, that triangle is the face.

Then for our public class stuff. Our constructor takes a string path (constant so we dont fuzz about with it accidentally later on). Then our functions, quite simple. Constant get functions because we dont intend to change models after they have loaded in right now so our vertex count and face count will not change. Lets take a look at the cpp file now

Lets start simple with this little helper function that takes a reference to str and…

Similar Posts

Loading similar posts...