Yousazoe

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: 作业3使用texture参数无法启动 #12874 Score: 0
    Yousazoe
    Participant

    也许你需要更改一下 Texture.hpp:

    diff
        Eigen::Vector3f getColor(float u, float v)
        {
    +       if(u < 0) u = 0;
    +       if(v < 0) v = 0;
    +       if(u > 1) u = 1;
    +       if(v > 1) v = 1;
    
            auto u_img = u * width;
            auto v_img = (1 - v) * height;
            auto color = image_data.at<cv::Vec3b>(v_img, u_img);
            return Eigen::Vector3f(color[0], color[1], color[2]);
        }
    

    因为你可以看一下 models/spot/spot_triangulated_good.obj 的范围,需要做一下预处理。

    Yousazoe
    Participant

    影响系数(是常数,老师给的代码框架中已经定义了值),表示纹理法线对真实物体的影响程度,和课上的c1c2代表的应该是同一种含义.

Viewing 2 posts - 1 through 2 (of 2 total)