디지털 그래픽스 8

[openGL] 광원 메소드 확장 - 종류변경, y축회전, angle변경, attentuation(감쇠값) 변경, 초기화, z축 위치변경

코드) #include #include #include using namespace std; int w = 500, h = 500; void init() { glViewport(0, 0, w, h); glClearColor(0.0, 0.0, 0.0, 0.0); glEnable(GL_DEPTH_TEST); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); } float spin = 0;//spin하는 속도 int ltype = 1;//광원 종류 (디폴트: 1) float angle = 45;//spotlight angle (디폴트: 45) float atte = 1.5;//spotlight attentuation (디폴트: 1.5) float zdist = 1;//광원의 z축 ..