#include #include #include "utils.h" #include #include #include #include #include #include #include #include "Sphere.h" #include "Torus.h" #include "ImportedModel.h" #define numVAOs 1 #define numVBOs 11 GLuint renderingProgram; GLuint vao[numVAOs]; GLuint vbo[numVBOs]; glm::vec3 camera; GLuint globalAmbLoc,ambLoc,diffLoc,specLoc,lPosLoc,mAmbLoc,mDiffLoc,mSpecLoc,mShinLoc,mvLoc,projLoc,nLoc; int width, height; float aspect; glm::mat4 mMat, pMat, vMat, mvMat,invTrMat; glm::vec3 currentLightPos,lightPosV; std::arraylightPos; glm::vec3 initialLightLoc={0.0f,2.0f,4.0f}; float globalAmbient[4] = { 0.7f, 0.7f, 0.7f, 1.0f }; float lightAmbient[4] = { 0.0f, 0.0f, 0.0f, 1.0f }; float lightDiffuse[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; float lightSpecular[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; float* matAmb = utils::silverAmbient(); float* matDif = utils::silverDiffuse(); float* matSpe = utils::silverSpecular(); float matShi = utils::silverShininess(); float* matAmb2 = utils::jadeAmbient(); float* matDif2 = utils::jadeDiffuse(); float* matSpe2 = utils::jadeSpecular(); float matShi2 = utils::jadeShininess(); std::stacktransforms; GLuint pyrTex; Sphere sphere(48); Torus torus(1.0,0.5,48); ImportedModel shuttle("shuttle.obj"); void setupVertices(void) { glGenVertexArrays(1, vao); glBindVertexArray(vao[0]); glGenBuffers(numVBOs, vbo); std::vectorindices=sphere.getIndices(); std::vectorvertices=sphere.getVertices(); std::vectoruvs=sphere.getTexCoords(); std::vectornormals=sphere.getNormals(); std::vectorpvalues; std::vectortvalues; std::vectornvalues; for(int i=0;i