|
|
@ -87,7 +87,7 @@ INT WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _ |
|
|
|
|
|
|
|
//init 3d model
|
|
|
|
ObjModel model; |
|
|
|
model.Init("res/model/Quad.obj"); |
|
|
|
model.Init("res/model/Sphere.obj"); |
|
|
|
|
|
|
|
float identity[] = { |
|
|
|
1.0f,0,0,0, |
|
|
@ -99,15 +99,15 @@ INT WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _ |
|
|
|
float ambientMaterial[] = { 0.2f,0.2f,0.2f,1.0f }; |
|
|
|
float diffuseLightColor[] = { 1.0f,1.0f,1.0f,1.0f }; |
|
|
|
float diffuseMaterial[] = { 0.6f, 0.6f, 0.6f, 1.0f }; |
|
|
|
float lightPos[] = {0.0f,1.5f,-3.0f,1.0f}; |
|
|
|
float lightPos[] = {0.0f,3.0f,-2.5f,1.0f}; |
|
|
|
|
|
|
|
float spotLightDirection[] = {0.0f, -1.0f, 0.0f, 110.0f};//把最后一位改成......
|
|
|
|
float spotLightCutoff = 15.0f; |
|
|
|
float spotLightDirection[] = {0.0f, -1.0f, 0.0f, 628.0f};//把最后一位改成......
|
|
|
|
float spotLightCutoff = 5.0f; |
|
|
|
float specularLightColor[] = { 1.0f,1.0f,1.0f,1.0f }; |
|
|
|
float specularMaterial[] = { 1.0f,1.0f,1.0f,1.0f }; |
|
|
|
float eyePos[] = { 0.0f,0.0f,0.0f }; |
|
|
|
|
|
|
|
glm::mat4 modelMatrix = glm::translate<float>(0.0f, -0.5f, -3.0f) * glm::rotate(-90.0f, 1.0f, 0.0f, 0.0f) * glm::scale(2.0f, 2.0f, 2.0f); |
|
|
|
glm::mat4 modelMatrix = glm::translate<float>(0.0f, 0.0f, -3.0f) * glm::rotate(-30.0f, 1.0f, 1.0f, 1.0f); |
|
|
|
glm::mat4 projectionMatrix = glm::perspective(50.0f, 800.0f / 600.0f, 0.1f, 1000.0f); |
|
|
|
|
|
|
|
glm::mat4 normalMatrix = glm::inverseTranspose(modelMatrix); |
|
|
|