Question: 3. Model Transformations (12 marks) Assume the following basic transformation functions are provided in a library and can be used by your program segments: mata

 3. Model Transformations (12 marks) Assume the following basic transformation functions

3. Model Transformations (12 marks) Assume the following basic transformation functions are provided in a library and can be used by your program segments: mata Translate{float x,float dy. float day Il return the 4x4 translation matrix mate Scaling float sx float sy, floats Il return the 4x4 scaling matrix matt Rotation float angle: I return the due rotation matrix around x-axis mata Rotation float angles 1/ return the 4x4 rotation matrix around y-axis mat4 RotationZifloat angle // return the ds rotation mateix around andis Furthermore, a C++ style operator overlodaing has been defined for matrix-matrix multiplication The object shown below is flat and parallel to the xy plane. It is to be enlarged by a factor of 2, rotated about the reference point PO (5, 5.5) such that the object will be parallel to the y z plane. Write a segment of code to construct the matrix necessary for the above transformation operation, -END 3. Model Transformations (12 marks) Assume the following basic transformation functions are provided in a library and can be used by your program segments: mata Translate{float x,float dy. float day Il return the 4x4 translation matrix mate Scaling float sx float sy, floats Il return the 4x4 scaling matrix matt Rotation float angle: I return the due rotation matrix around x-axis mata Rotation float angles 1/ return the 4x4 rotation matrix around y-axis mat4 RotationZifloat angle // return the ds rotation mateix around andis Furthermore, a C++ style operator overlodaing has been defined for matrix-matrix multiplication The object shown below is flat and parallel to the xy plane. It is to be enlarged by a factor of 2, rotated about the reference point PO (5, 5.5) such that the object will be parallel to the y z plane. Write a segment of code to construct the matrix necessary for the above transformation operation, -END

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!