Final Grade

비밀번호 중간고사 기말고사 출석 (20%) 중간고사 (30%) 기말고사 (30%) 실습1 실습2-0 실습2 실습3 실습총점20 실습 (20%) TOTAL
1001 25 42 19.667 7.5 12.6 10 2 3 0 5 10 49.767
1777 22 30 15.667 6.6 9 10 1 3 0 4.6667 9.3333 40.6
6062 12 20 17 3.6 6 0 0 0 0 0 0 26.6
1036 0 18 16.333 0 5.4 0 0 0 0 0 0 21.733
830 19 13 18.667 5.7 3.9 0 0 0 0 0 0 28.267
4290 65 54 20 19.5 16.2 10 2 10 8 10 20 75.7
1302 50 55 20 15 16.5 10 2 3 0 5 10 61.5
1932 41 56 20 12.3 16.8 10 2 10 10 10.667 21.333 70.433
9376 27 29 18.667 8.1 8.7 0 2 0 0 0.6667 1.3333 36.8

Billboarding & AlphaBlendTextures

Billboarding & AlphaBlendTextures

lab16-BillboardingTextureShadedQuad2

 

yaw
Look

// create a axis-aligned billboard matrix
void buildAxisAlignedBillboardMatrix(glm::mat4& m, glm::vec3& axis)
{
// calculate “-yaw” angle from View matrix (Look.x, Look.z)
float theta = -atan2f(m[0][2], m[2][2]);

float ct = cosf(theta);
float st = sinf(theta);

// normalize
axis = glm::normalize(axis);

// clear out the view matrix passed in
m = glm::mat4(1.0f);

//———————————————
// R = uu’ + cos(theta)*(I-uu’) + sin(theta)*S
//
// S =  0  -z   y    u’ = (x, y, z)
//     z   0  -x
//    -y   x   0
//———————————————
// calculate “Rotation” matrix using “axis” & “theta”
m[0][0] = axis[0] * axis[0] + ct*(1 – axis[0] * axis[0]) ;
m[0][1] = axis[0] * axis[1] + ct*(0 – axis[0] * axis[1]) + st*(-axis[2]);
m[0][2] = axis[0] * axis[2] + ct*(0 – axis[0] * axis[2]) + st*axis[1];

m[1][0] = axis[1] * axis[0] + ct*(0 – axis[1] * axis[0]) + st*axis[2];
m[1][1] = axis[1] * axis[1] + ct*(1 – axis[1] * axis[1]) ;
m[1][2] = axis[1] * axis[2] + ct*(0 – axis[1] * axis[2]) + st*(-axis[0]);

m[2][0] = axis[2] * axis[0] + ct*(0 – axis[2] * axis[0]) + st*(-axis[1]);
m[2][1] = axis[2] * axis[1] + ct*(0 – axis[2] * axis[1]) + st*axis[0];
m[2][2] = axis[2] * axis[2] + ct*(1 – axis[2] * axis[2]) ;
}

Billboard가 활성화가 되지 않은 상태 (카메라의 시점이 회전된 상태에 따라 알파텍스쳐 나무가 원래 위치한대로 그대로 유지함)

nobillboard

 

Billboard가 활성화된 상태 (카메라의 시점이 회전된 상태라 해도 알파텍스쳐 나무가 내 시점을 향하여 바라보는 상태를 유지함)

billboard

 

 

Blending Filter

Blending filter

lab16-BlendFilterTextureShadedQuad2

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) // brighten the scene = Cs*As + Cd*1
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
else if (g_filter == 5) // Modulate 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);
Default (no blending)
noblending

Draw background only

backgroundonly

Add blending

addblending

Alpha blending

alphablending

Brighten the scene

additiveblending

Modulate blending

modulateblending

Darken the scene

darken

Invert all the colors

invert