|
|
@ -133,6 +133,8 @@ INT WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine |
|
|
|
glEnable(GL_DEPTH_TEST); |
|
|
|
glEnable(GL_POINT_SPRITE); |
|
|
|
glEnable(GL_PROGRAM_POINT_SIZE); |
|
|
|
glEnable(GL_BLEND); |
|
|
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
|
|
|
glViewport(0,0, windowWidth, windowHeight); |
|
|
|
|
|
|
|
//创建一个单位矩阵和一个投影矩阵,后面用来传递到shader
|
|
|
@ -143,13 +145,14 @@ INT WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine |
|
|
|
0,0,0,1 |
|
|
|
}; |
|
|
|
|
|
|
|
glm::mat4 model = glm::translate(-1.0f, 0.0f, -3.0f)*glm::rotate(-20.0f, 0.0f, 1.0f, 0.0f); |
|
|
|
glm::mat4 model = glm::translate(0.0f, 0.0f, -3.0f)*glm::rotate(-20.0f, 0.0f, 1.0f, 0.0f); |
|
|
|
glm::mat4 projection = glm::perspective(45.0f, (float)windowWidth / (float)windowHeight, 0.1f, 1000.0f); |
|
|
|
glm::mat4 normalMatrix = glm::inverseTranspose(model); |
|
|
|
|
|
|
|
Frustum frustum; |
|
|
|
frustum.Init(); |
|
|
|
frustum.InitPerspective(45.0f, (float)windowWidth / (float)windowHeight, 0.1f, 4.0f); |
|
|
|
//frustum.InitPerspective(45.0f, (float)windowWidth / (float)windowHeight, 0.1f, 4.0f);
|
|
|
|
frustum.InitOrtho(-0.5f, 0.5f,-0.5, 0.5,0.1f,4.0f); |
|
|
|
|
|
|
|
/*显示窗口*/ |
|
|
|
ShowWindow(hwnd, SW_SHOW); |
|
|
|