Learning C, Day 26 (Camera Clipping 4)

Camera clipping UV coordinate interpolation! It only took like an hour to add and it was really simple. I used linear interpolation between the polygon points on either side of the clipping plane to get the UV coordinates of the new point. I thought I might need barycentric coordinates to interpolate the values, but because the points are always on one edge of the original triangle, I only have to consider the two points of that edge.

I also spent an hour refactoring and cleaning the code. The renderer is almost done and I’m nearing the end of the 3D graphics programming course. The main things left to add are multi-mesh support and a better camera controller. Then it should be ready for making games and memes :D!

1 comment

Leave a comment

Your email address will not be published. Required fields are marked *


Your data is processed in accordance with my privacy policy. Comments are manually approved and may take a while to appear.