ZsIsMe / ios_core_animation_advanced_techniques

648 stars 169 forks source link

"固体对象"部分光亮和阴影部分 代码好像有问题 #10

Open awanglilong opened 8 years ago

awanglilong commented 8 years ago

normal = GLKMatrix3MultiplyVector3(matrix3, normal); 计算出的结果为 (GLKVector3) normal = { = (s = 0, t = 0, p = 0) = (s = 0, t = 0, p = 0) = (s = 0, t = 0, p = 0) v = ([0] = 0, [1] = 0, [2] = 0) }

normal = GLKVector3Normalize(normal); 计算出的结果为

(GLKVector3) normal = { = (s = NaN, t = NaN, p = NaN) = (s = NaN, t = NaN, p = NaN) = (s = NaN, t = NaN, p = NaN) v = ([0] = NaN, [1] = NaN, [2] = NaN) }

awanglilong commented 8 years ago
GLKMatrix4 matrix4 = *(GLKMatrix4 *)&transform;  是这句话的问题

GLKMatrix4 matrix4 = GLKMatrix4Make(transform.m11, transform.m12, transform.m13, transform.m14, transform.m21, transform.m22, transform.m23, transform.m24, transform.m31, transform.m32, transform.m33, transform.m34, transform.m41, transform.m42, transform.m43, transform.m44);这样写就好了