Description
-
From Model to Screen (80 points)
If we want to get a model to screen, we bacially need the following steps:
-
Model Translation T
-
Model Scaling S
-
Model Rotation R
-
View Translation
-
View Rotation
-
Project
Written in Matrix production:
-
-
M odelV iewP roject = P roject V iewR V iewT M odelS M odelR M odelT
(1)
-
For this assignment, your tasks are
1.1 Implement Model Matrix (40 Points)
Complete the given function.
-
1
get_model_matrix( f l o a t rotation_angle ,
2
Eigen:: Vector3f T,
3
Eigen:: Vector3f S,
4
Eigen:: Vector3f
P0,
5
Eigen:: Vector3f
P1):
Note: express the tranforms in each steps use homogeneous coordinates. For example use 4 Matrix to express the translation Vector3f T. (You can also validate your results by using the Eigen’s lib function.)
Follow the instructions in the give code structure.
1.2 Implement perspective projection Matrix (40 Points)
-
1
get_projection_matrix( f l o a t
eye_fov,
2
f l o a t
aspect_ratio ,
3
f l o a t zNear,
4
f l o a t
Zfar )
1.3 Implement main() function according to your needs (20 Points)
4