Vinal

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: 作业三深度差值疑问 #4356 Score: 0
    Vinal
    Participant

    谢谢 我详细看一下

    in reply to: 作业1get_view_matrix函数可能没理解到位 #3059 Score: 0
    Vinal
    Participant

    作业里要填的函数也都有类似的写法,如get_model_matrix中第一行是Eigen::Matrix4f model = Eigen::Matrix4f::Identity();
    那这个model我需要管嘛?是不是定义另一个矩阵,然后直接赋值、返回就行了?如下面是我的做法,不知道我理解是否有误:

    Eigen::Matrix4f get_model_matrix(float rotation_angle)
    {
        Eigen::Matrix4f model = Eigen::Matrix4f::Identity();
    
        // TODO: Implement this function
        // Create the model matrix for rotating the triangle around the Z axis.
        // Then return it.
    	Eigen::Matrix4f r;
    	r << cos(rotation_angle), -sin(rotation_angle), 0, 0,
    		sin(rotation_angle), cos(rotation_angle), 0, 0,
    		0,                      0,                1, 0,
    		0,                      0,                1, 1;
    
        return r;
    }
Viewing 2 posts - 1 through 2 (of 2 total)