
[OpenGL] 16. Transformation (4) - 셰이더에 행렬 변환 적용하기
이번 글에서는 셰이더에 행렬 변환을 적용해보려고 한다. 이 예제로 한번 사람의 팔과 비슷하게 동작하는 프로그램을 작성해보려고 한다. 키보드를 눌러 각도를 조작하면 팔이 회전할 수 있다. 팔의 회전은 상박따로, 하박 따로 회전한다. 기본 코드 틀 #include #include #include "Shader.h" #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" #include #include #include float vertice[] { -0.3, -0.2, 1.0, // left - bottom +0.3, -0.2, 1.0, // right - bottom -0.3, +0.0, 1.0, // left - top +0.3, +0.0, 1.0, // ri..