Home Forums GAMES在线课程(现代计算机图形学入门)讨论区 问题5不知道什么原因,画出来的图是这样的

Viewing 4 reply threads
  • Author
    Posts
    • #4870 Score: 0
      胡奔
      Participant
      1 pt

      我修改了color(第四张截图)后面的转化为int,我在mac系统上运行说我超出char的范围

      Attachments:
      You must be logged in to view attached files.
    • #4875 Score: 0
      胡奔
      Participant
      1 pt

      有人遇到过相同的状况吗,不知道是哪里出错了,参考的是链接:https://www.scratchapixel.com/lessons/3d-basic-rendering/ray-tracing-generating-camera-rays/generating-camera-rays

      • This reply was modified 4 years ago by 胡奔.
    • #4879 Score: 0
      slongle(助教)
      Keymaster
      13 pts

      int转unsigned char确实超范围呀,但是这个类型转换在这个情况下,结果是没问题的。编译器报Warning或者RE的都有可能,你要是报RE就把类型转换改过去。
      球能正常显示的话,查一下光线三角形相交吧。

      • #4882 Score: 0
        胡奔
        Participant
        1 pt

        你好助教,那个光线和三角形相交代码,我反复看了闫老师的上课ppt,应该是对的,但是结果一直不正确,

        Attachments:
        You must be logged in to view attached files.
      • #4885 Score: 0
        胡奔
        Participant
        1 pt

        结果在这里

        Attachments:
        You must be logged in to view attached files.
      • #4888 Score: 0
        胡奔
        Participant
        1 pt

        知道错在哪里了,求Right的时候,不能合在一起,那种表达方式会有问题,要分别算tnear,u,v

    • #4894 Score: 0
      Yuan Hp
      Participant

      把Vector3f Right = (…)这行改为Vector3f Right(…)这种形式就可以了,不要等号

      • #4895 Score: 0
        胡奔
        Participant
        1 pt

        对的,这样也可以

        • #4911 Score: 1
          欠你一枝花
          Participant
          4 pts

          请教一下, 为啥要让tnear, u, v分别等于Res.x, Res.y, Res.z, 我还以为u和v还要根据作业3的重心坐标来重新插值呢?

          This post has received 1 vote up.
          • #4923 Score: 1
            胡奔
            Participant
            1 pt

            你好,我个人认为这个MT算法的目的主要是判断交点是否在三角形内部,这与之前纹理,深度等需要通过重心坐标来插值不太一样

            This post has received 1 vote up.
      • #4915 Score: 0
        SHERLOCK
        Participant
        -1 pt

        请问这里是不是少了从NDC空间到screen space 那一步?

        • #4922 Score: 0
          胡奔
          Participant
          1 pt

          你好,可以看一下这个链接:https://www.scratchapixel.com/lessons/3d-basic-rendering/ray-tracing-generating-camera-rays/generating-camera-rays,里面讲的很详细

        • #4973 Score: 0
          kingil
          Participant
          1 pt

          不要再去想什么NDC啊这些的,其实我的理解那样想就太麻烦了,只是一个取了巧的二维平面映射找到了视角的那条光线而已。

          作业5Primary Ray的理解和计算问题


          有空我会画个图来解释下。

    • #4945 Score: 0
      欠你一枝花
      Participant
      4 pts

      谢谢, 请教一下, tnear这个我能理解, 但是Res.y和Res.z对应的是MT算法的b1和b2. 这个东西跟u, v又有啥关系呢?

      • #4946 Score: 0
        胡奔
        Participant
        1 pt

        你好,这两个代表是同一个东西,u就是b1,v就是b2,只是变量表现的形式不同

Viewing 4 reply threads
  • You must be logged in to reply to this topic.