Relative Content

Tag Archive for openglrotationprojectionglmtranslate

draw cubes with index buffer in openGL

#include <stdio.h> #include <stdlib.h> #include <string> #include <iostream> #include <fstream> #include <vector> #include <algorithm> #include <GL/glew.h> #include <GL/glut.h> #include <GL/glm/glm.hpp> #include <GL/glm/gtx/transform.hpp> // rotate(), scale(), translate() #include <GL/glm/gtc/quaternion.hpp> #include <GL/glm/gtc/type_ptr.hpp> using namespace std; GLuint VertexArrayID; GLuint programID; float sx = 0; float sy = 0; bool projMode = true; // true: perspective, false: ortho GLuint […]