Home › Forums › GAMES在线课程(现代计算机图形学入门)讨论区 › 提高部分测试问题
- This topic has 8 replies, 5 voices, and was last updated 4 years, 9 months ago by .J..
Viewing 4 reply threads
-
AuthorPosts
-
-
MingWangParticipant
提高部分的任务是在main.cpp中完成一个函数,请问这个函数功能的正确性如何测试?
-
可以先将get_model_matrix函数注释掉,然后编写好get_rotation函数。
接着,将main函数中两处r.set_model(get_model_matrix(angle))注释掉,改为r.set_model(get_rotation(axis(自己随意选),angle))即可编译调试。 -
构造一个函数,该函数的作用是得到绕任意过原点的轴的旋转变换矩阵。
请问一下助教老师:
绕任意过原点的轴是指x,y,z轴吗?-
MingWangParticipant
不是。应该指的是任意方向的轴。
-
-
好的,明白,谢谢老师!
-
我写了一个新的命令行parser部分,测起来就比较方便了。
while (parsePos < argc) { std::string arg = std::string(argv[parsePos]); if (arg == "-r") { if (parsePos + 1 >= argc) { std::cerr << "-r option error" << std::endl; std::cerr << "Usage: " << argv[0] << " -r angle [-a axisX axisy axisZ] [filename.png]" << std::endl; exit(-1); } angle = std::stof(argv[parsePos + 1]); parsePos += 2; } else if (arg == "-a") { if (parsePos + 3 >= argc) { std::cerr << "-a option error" << std::endl; std::cerr << "Usage: " << argv[0] << " -r angle [-a axisX axisy axisZ] [filename.png]" << std::endl; exit(-1); } raxis.x() = std::stof(argv[parsePos + 1]); raxis.y() = std::stof(argv[parsePos + 2]); raxis.z() = std::stof(argv[parsePos + 3]); parsePos += 4; } else if (arg.rfind(".png") == arg.size() - 4) { command_line = true; filename = arg; parsePos += 1; } else { std::cerr << "Invalid option or filename: " << arg << std::endl; std::cerr << "Usage: " << argv[0] << " -r angle [-a axisX axisy axisZ] [filename.png]" << std::endl; exit(-1); } }
-
为什么code的字体这么小呢?
-
-
-
AuthorPosts
Viewing 4 reply threads
- You must be logged in to reply to this topic.