For the third part, a lot of new features are introduced to the ray tracer. 1. Transformations In order to implement transformations, firstly I implemented a Matrix4f class which is able to support basic matrix operations such as inverse, transpose, multiplication with another matrix or a vector etc. Three types of transformations which are Translation , Rotation and Scaling are supported in this new version of the ray tracer. While parsing the scene, final Transformation Matrices are stored for each object, which will be used for transforming Rays , Hits and BoundingBoxes later. For meshes, the transformation matrix is stored only for the main mesh object, not for all of its children triangles. In addition, for transforming bounding boxes, transformations are applied to all 8 corners of the bounding box and the new bounding box is computed based on these new corners, instead of applying the transformations directly to the min and max corners. To intersect rays with the transformed...
Comments
Post a Comment