Home Forums GAMES在线课程(现代计算机图形学入门)讨论区 作业3 rasterizer output.png normal

  • This topic has 3 replies, 2 voices, and was last updated 1 year ago by kinuo.
Viewing 3 reply threads
  • Author
    Posts
    • #17050 Score: 0
      kinuo
      Participant

      完成第一和第二项,插值和透视投影矩阵后。输入了rasterizer output.png normal之后只在终端里显示Rasterizing using the normal shader。

      Attachments:
      You must be logged in to view attached files.
    • #17053 Score: 0
      kinuo
      Participant

      H:\programing\cpp_file\ustcCG\games101\week5\rasterizer.hpp:107:14: error: ‘optional’ in namespace ‘std’ does not name a template type
      std::optional<Texture> texture;
      ^~~~~~~~
      H:\programing\cpp_file\ustcCG\games101\week5\rasterizer.hpp:107:9: note: ‘std::optional’ is only available from C++17 onwards
      std::optional<Texture> texture;
      ^~~
      可是cmakelists里面,.vscode的各个文件里面都是c17。

    • #17338 Score: 0
      zengJB
      Participant

      同学你解决了吗,我也遇到这个问题了

    • #17340 Score: 0
      kinuo
      Participant

      抱歉哈 我也忘記了。只能提供一些我的文件中的一些信息給你參考了。
      ********in CMakeLists.txt
      cmake_minimum_required(VERSION 3.10)
      project(Rasterizer)

      find_package(OpenCV REQUIRED)

      set(CMAKE_CXX_STANDARD 17)
      set(CMAKE_CXX_STANDARD_REQUIRED True)

      set(CMAKE_C_COMPILER “H:\\compiler\\mingw64\\bin\\gcc.exe”)
      set(CMAKE_CXX_COMPILER “H:\\compiler\\mingw64\\bin\\g++.exe”)
      include_directories(“H:\\programing\\cpp_file\\ustcCG\\Eigen”)

      add_executable(Rasterizer main.cpp rasterizer.hpp rasterizer.cpp global.hpp Triangle.hpp Triangle.cpp Texture.hpp Texture.cpp Shader.hpp OBJ_Loader.h)
      target_link_libraries(Rasterizer ${OpenCV_LIBRARIES})
      #target_compile_options(Rasterizer PUBLIC -Wall -Wextra -pedantic)

      *********in Texture.hpp
      #ifndef RASTERIZER_TEXTURE_H
      #define RASTERIZER_TEXTURE_H
      #include “global.hpp”
      #include <Eigen/Eigen>
      #include <opencv2/opencv.hpp>

      *********in main.cpp
      #include <iostream>
      #include <opencv2/opencv.hpp>

      #include “global.hpp”
      #include “rasterizer.hpp”
      #include “Triangle.hpp”

      #include “Shader.hpp”
      #include “Texture.hpp”
      #include “OBJ_Loader.h”

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