mbt680 / CGP

project
0 stars 1 forks source link

Modify WavefrontParser and Model/Mesh/Face class to accept surface normals #2

Closed bradley-mcfadden closed 2 years ago

bradley-mcfadden commented 2 years ago

Lighting and suggestive contours require surface normals (vectors pointing away from the face of the model to the outside) to be added to our models. Currently, we only store positions of each vertex. We would need to modify a lot of drawing code as well to add in these surface normals. Changes would be needed to our shaders to accept the normals, and rendering code in the Model class. Additionally, the parser would have to be modified to read in the files containing the surface normals.

bradley-mcfadden commented 2 years ago

Adding normals is done in terms of the Model and WavefrontParser class. Our shader needs to be updated to use them, and they need to be passed to the program in the Model.init() code in draw().