|
|
|
@ -33,10 +33,10 @@ 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* matAmb = utils::goldAmbient(); |
|
|
|
|
float* matDif = utils::goldDiffuse(); |
|
|
|
|
float* matSpe = utils::goldSpecular(); |
|
|
|
|
float matShi = utils::goldShininess(); |
|
|
|
|
|
|
|
|
|
float* matAmb2 = utils::jadeAmbient(); |
|
|
|
|
float* matDif2 = utils::jadeDiffuse(); |
|
|
|
@ -50,7 +50,7 @@ GLuint pyrTex; |
|
|
|
|
|
|
|
|
|
Sphere sphere(48); |
|
|
|
|
Torus torus(1.0,0.5,48); |
|
|
|
|
ImportedModel shuttle("shuttle.obj"); |
|
|
|
|
ImportedModel shuttle("StanfordDragon.obj"); |
|
|
|
|
|
|
|
|
|
void setupVertices(void) { |
|
|
|
|
glGenVertexArrays(1, vao); |
|
|
|
@ -130,8 +130,10 @@ void setupVertices(void) { |
|
|
|
|
pvalues.push_back(vertices[i].x); |
|
|
|
|
pvalues.push_back(vertices[i].y); |
|
|
|
|
pvalues.push_back(vertices[i].z); |
|
|
|
|
tvalues.push_back(uvs[i].s); |
|
|
|
|
tvalues.push_back(uvs[i].t); |
|
|
|
|
if(uvs.size()>0){ |
|
|
|
|
tvalues.push_back(uvs[i].s); |
|
|
|
|
tvalues.push_back(uvs[i].t); |
|
|
|
|
} |
|
|
|
|
nvalues.push_back(normals[i].x); |
|
|
|
|
nvalues.push_back(normals[i].y); |
|
|
|
|
nvalues.push_back(normals[i].z); |
|
|
|
@ -274,9 +276,9 @@ void display(GLFWwindow* window, double currentTime) { |
|
|
|
|
|
|
|
|
|
//vMat=glm::lookAt(glm::vec3{camera.x,camera.y,camera.z},{0,-3,0},{0,1,0});
|
|
|
|
|
|
|
|
|
|
mMat=glm::translate(glm::mat4(1.0f),{0.f,-2.f,0.f}); |
|
|
|
|
mMat=glm::rotate(mMat,float(currentTime/4),{0.f,1.f,0.2f}); |
|
|
|
|
mMat=glm::scale(mMat,{7,7,7}); |
|
|
|
|
mMat=glm::translate(glm::mat4(1.0f),{0.f,-8.f,0.f}); |
|
|
|
|
mMat=glm::rotate(mMat,float(currentTime/4),{0.f,1.f,0.f}); |
|
|
|
|
mMat=glm::scale(mMat,{60,60,60}); |
|
|
|
|
mvMat=vMat*mMat; |
|
|
|
|
|
|
|
|
|
invTrMat=glm::transpose(glm::inverse(mvMat)); |
|
|
|
@ -298,7 +300,7 @@ void display(GLFWwindow* window, double currentTime) { |
|
|
|
|
|
|
|
|
|
invTrMat=glm::transpose(glm::inverse(mvMat)); |
|
|
|
|
|
|
|
|
|
DrawTorus(); |
|
|
|
|
//DrawTorus();
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int main(void) { |
|
|
|
|