unkvcc

Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • unkvcc
    Participant
    2 pts

    我也是报这个错误,请问楼主弄明白了吗

    in reply to: 作业3踩坑分享 #12068 Score: 2
    unkvcc
    Participant
    2 pts

    bump用到了displacement是什么意思?
    就是说,在根据凹凸贴图UV计算新的法向量后,顶点要实际移动,按照注释多写一行,然后再修改法向量
    point = point + kn * n * payload.texture->getColor(u,v).norm();

    This post has received 2 votes up.
    • This reply was modified 1 year, 9 months ago by unkvcc.
    Attachments:
    You must be logged in to view attached files.
    in reply to: 作业3踩坑分享 #12067 Score: 0
    unkvcc
    Participant
    2 pts

    已解决,没有把光照颜色计算的结果累加起来,而是覆盖了上一个光照颜色计算的结果

    in reply to: phong模型高光位置不对 #12062 Score: 0
    unkvcc
    Participant
    2 pts

    感谢楼上各位的解答,光照的计算结果应该叠加,我这个图片就是没有叠加直接赋值的效果

    Attachments:
    You must be logged in to view attached files.
    in reply to: 作业3踩坑分享 #12058 Score: 0
    unkvcc
    Participant
    2 pts

    牛牛身体部分较暗,不知哪里出了问题?高光是按照公式计算的

    Attachments:
    You must be logged in to view attached files.
    in reply to: 关于作业2两个三角形重叠部分的Z-Buffer问题 #12033 Score: 0
    unkvcc
    Participant
    2 pts

    感谢解答。我的理解是之前做MVP变换时采用了-z的值,那么做视图变换时也应该采用顶点的-z
    `
    // 单位立方体的边长
    float f1 = (50 – 0.1) / 2.0;
    // 单位立方体的中心点的z值 反转后的 正值
    float f2 = (50 + 0.1) / 2.0;
    ……
    // 变换前的点(0,0) 变换后应该在(width/2,height/2) 的位置
    //Viewport transformation
    for (auto & vert : v)
    {
    vert.x() = 0.5*width*(vert.x()+1.0);
    vert.y() = 0.5*height*(vert.y()+1.0);
    // 因为之前为了方便计算z值,将z值设置成正值
    // 而我们做MVP变换时,采用的是z值的负值
    // 所以这里再做视口变换,应改回负值
    vert.z() = -vert.z() * f1 + f2;
    // vert.z() = vert.z() * f1 + f2;
    }
    `

    unkvcc
    Participant
    2 pts

    我将远近屏幕的正值改为了负值,改后的三角形朝上,绕X轴旋转起来跟你的不一样

    • This reply was modified 1 year, 9 months ago by unkvcc.
    Attachments:
    You must be logged in to view attached files.
    unkvcc
    Participant
    2 pts

    作业一提高部分报错
    问题记录:
    按照课件的罗格里德斯旋转公式,绕任意轴z轴旋转时,发现三角形先会变大再变小
    分析成因:
    因为我将三维向量都转化为四维,最后才代入公式计算
    解决:
    如果先计算完公式,再组合成四维矩阵,就不会出现这样的问题

    in reply to: 作业1发布公告 #12019 Score: 0
    unkvcc
    Participant
    2 pts

    老师在推导投影公式的时候,相机看向-z方向,在标准立方体 [l,r] x [b,t] x [f,n] 中假设了近平面的z值大于远平面的z值,如果近平面是 -0.5 远平面是 -50 ,最终得到的就是方向朝上的三角形。

    in reply to: 作业一的一点点小小心得分享 #12018 Score: 0
    unkvcc
    Participant
    2 pts

    Mac环境,按照课件的公式来写代码,得到的三角形,中间的角是朝下的

    in reply to: MacOS上能做作业吗 #12017 Score: 0
    unkvcc
    Participant
    2 pts

    mac环境配置没整明白,自行安装了eigen库,直接编译能过 g++ main.cpp -o Test
    但是 cmake .. 然后 make 报错,找不到头文件

    in reply to: 作业0发布公告 #12007 Score: 0
    unkvcc
    Participant
    2 pts

    首先使用缩放模式,View->Scaled Mode

    然后在虚拟机桌面空白地方,右键->切换背景->Devices->Displays->Resolution 切换一下屏幕分辨率就好了

    • This reply was modified 1 year, 9 months ago by unkvcc.
Viewing 12 posts - 1 through 12 (of 12 total)