Skip to content

Instantly share code, notes, and snippets.

@Lewuathe
Created December 11, 2012 12:21
Show Gist options
  • Save Lewuathe/4258157 to your computer and use it in GitHub Desktop.
Save Lewuathe/4258157 to your computer and use it in GitHub Desktop.
OpenGL ESでオブジェクトを動かす ref: http://qiita.com/items/f39568a8da1cccb6e5f0
_projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(65.0f), aspect, 0.1f, 100.0f);
_baseViewMatrix = GLKMatrix4Translate(GLKMatrix4Identity, 0.0f, 0.0f, _nearness);
_modelViewMatrix = GLKMatrix4Multiply(GLKMatrix4Identity, _baseViewMatrix);
- (void)update{
_baseViewMatrix = GLKMatrix4Translate(GLKMatrix4Identity, 0.0f, 0.0f, _nearness);
_modelViewMatrix = GLKMatrix4Rotate(_baseViewMatrix, _angle, 1.0f, 0.0f, 0.0f);
_modelViewMatrix = GLKMatrix4Rotate(_modelViewMatrix, _rotation, 0.0f, 1.0f, 0.0f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment