OpenGL初始
易水凌波
守正笃实,久久为工。
展开
-
光照
main.cpp#define STB_IMAGE_IMPLEMENTATION#include <glad/glad.h>#include <GLFW/glfw3.h>#include <glm/glm.hpp>#include <glm/gtc/matrix_transform.hpp>#include <glm/gtc/type_ptr.hpp>#include <assimp/Importer.hpp>#inc原创 2020-11-02 17:48:28 · 137 阅读 · 0 评论 -
摄像机
main.cpp#define STB_IMAGE_IMPLEMENTATION#include <glad/glad.h>#include <GLFW/glfw3.h>#include <glm/glm.hpp>#include <glm/gtc/matrix_transform.hpp>#include <glm/gtc/type_ptr.hpp>#include <iostream>#include <std原创 2020-10-31 15:30:43 · 175 阅读 · 0 评论 -
纹理
main.cpp#define STB_IMAGE_IMPLEMENTATION#include <glad/glad.h>#include <GLFW/glfw3.h>#include <iostream>#include "stb_image.h"#include "shader_s.h"using namespace std;void framebuffer_size_callback(GLFWwindow* window, int width,原创 2020-10-25 20:34:23 · 88 阅读 · 1 评论 -
着色器
main.cpp:#include <glad/glad.h>#include <GLFW/glfw3.h>#include "shader_s.h"#include <iostream>void framebuffer_size_callback(GLFWwindow* window, int width, int height);void processInput(GLFWwindow* window);// settingsunsigned原创 2020-10-25 13:20:16 · 72 阅读 · 0 评论 -
OpenGL 绘制三角形
#include <glad/glad.h>#include <GLFW/glfw3.h>#include <iostream>using namespace std;float color1=0.0, color2 = 0.0, color3 = 0.0, color4 = 0.0;float vertices[] ={ -0.9,0,0, -0.45,0.45,0, 0,0,0,};float vertices2[] ={ 0,0,0,原创 2020-10-25 09:51:04 · 272 阅读 · 0 评论