This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GLKVector3 GLKMathProject(GLKVector3 object, GLKMatrix4 model, GLKMatrix4 projection, int *viewport) { | |
assert(viewport); | |
GLKVector4 v4 = GLKVector4MakeWithVector3(object, 1.0); | |
GLKVector4 v = GLKMatrix4MultiplyVector4(model, v4); | |
v = GLKMatrix4MultiplyVector4(projection, v); | |
v.v[3] = 1.0/v.v[3]; | |
v.v[0] *= v.v[3]; | |
v.v[1] *= v.v[3]; |