Home Forums GAMES在线课程(现代计算机图形学入门)讨论区 作业六debug时在读入模型时出错

Viewing 5 reply threads
  • Author
    Posts
    • #5021 Score: 1
      wffancy
      Participant
      1 pt

      如题,写完后执行结果为一张全蓝的图,debug时停在了Triangle.hpp的assert(loader.LoadedMeshes.size() == 1);这句,不知道什么原因,还请赐教
      报错信息:@”Assertion failed: (loader.LoadedMeshes.size() == 1), function MeshTriangle, file /Users/Documents/VScode Workspace/Graphics/Triangle.hpp, line 83.\r\n”

      This post has received 1 vote up.
    • #5030 Score: 0
      枫吟
      Participant
      1 pt

      你检测一下模型的位置有没有放对

      • #5031 Score: 0
        wffancy
        Participant
        1 pt

        就是按作业框架里放的,应该没问题的

    • #5033 Score: 0
      MXang
      Participant

      同样的错误 可是我输出了size发现它确实等于一,不明白为什么断言报错了。。

    • #5064 Score: 1
      奋斗的蜗牛
      Participant
      3 pts

      我遇到同样的问题,发现是你在哪个文件夹运行程序导致……

      ./build/RayTracing就会出现问题

      cd build
      ./RayTracing就会正确读入模型

      This post has received 1 vote up.
    • #5249 Score: 1
      Mxkkk
      Participant
      1 pt

      这里是因为main函数里读入模型用的是相对地址
      改成绝对地址或者在build下运行RayTracing就能解决

      This post has received 1 vote up.
    • #5326 Score: 0
      wffancy
      Participant
      1 pt

      感谢奋斗的蜗牛和Mxkkk同学。程序正常跑没问题,只有debug的时候会报错。修改为绝对地址或者修改debug的工作目录可以解决问题。之前把作业做完就没管这个问题啦,现在才看到XD

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