# 기말고사 정답

모두들 수고 하셨습니다. 2014년 그래픽스 프로그래밍 기말고사 정답입니다.9064432742.pdf

# Line Drawing Algorithm

line drawing algorithm
-DDA (Digital Differential Analyzer)
-Bresenham’s Line Drawing Algorithm

# OpenGLTextureBlendingGeometry

OpenGLTextureBlendingGeometry4900012935.zip

# OpenGL Blending Filter

OpenGL Blending Filter

14.OpenGLBlendingFilter.zip

glEnable(GL_BLEND);
if (g_filter == 0)                     // Default (no blending) = Cs*1
glBlendFunc(GL_ONE, GL_ZERO);
else if (g_filter == 1)                // Draw background only = Cd*1
glBlendFunc(GL_ZERO, GL_ONE);
else if (g_filter == 2)                // Cs*1 + Cd*1
glBlendFunc(GL_ONE, GL_ONE);
else if (g_filter == 3)                // Alpha blending (back-to-front) = Cs*As + Cd*(1-As)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
else if (g_filter == 4)                // Additive blending (brighten the scene) = Cs*As + Cd*1
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
else if (g_filter == 5)                // Multiplicative blending = Cd*Cs
glBlendFunc(GL_ZERO, GL_SRC_COLOR);
else if (g_filter == 6)                // darken the scene = Cd*As
glBlendFunc(GL_ZERO, GL_SRC_ALPHA);
else if (g_filter == 7)                 // Invert all the colors = Cs*(1-Cd)
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);