Created
December 11, 2012 12:21
-
-
Save Lewuathe/4258157 to your computer and use it in GitHub Desktop.
OpenGL ESでオブジェクトを動かす ref: http://qiita.com/items/f39568a8da1cccb6e5f0
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
_projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(65.0f), aspect, 0.1f, 100.0f); | |
_baseViewMatrix = GLKMatrix4Translate(GLKMatrix4Identity, 0.0f, 0.0f, _nearness); | |
_modelViewMatrix = GLKMatrix4Multiply(GLKMatrix4Identity, _baseViewMatrix); |
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
- (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