立方体を表示して回転させようとしています。このglkview drawinrect デリゲート メソッドを 1 回だけ呼び出すことに成功しました。
上記の参照リンクで言及したhttp://www.raywenderlich.com/5235/beginning-opengl-es-2-0-with-glkit-part-2からキューブをセットアップするコードを取得しました。
今私の問題は、キューブのサイズを大きくしたいということです。
私のコードを回転させるコードは次のとおりです。
#pragma mark - GLKViewControllerDelegate
- (void)update {
float aspect = fabsf(self.view.bounds.size.width / self.view.bounds.size.height);
GLKMatrix4 projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(65.0f), aspect, 4.0f, 10.0f);
self.effect.transform.projectionMatrix = projectionMatrix;
GLKMatrix4 modelViewMatrix = GLKMatrix4MakeTranslation(0.0f, 0.0f, -6.0f);
_rotation += -90 * self.timeSinceLastUpdate;//90 clockwise -90 anticlickwise
modelViewMatrix = GLKMatrix4Rotate(modelViewMatrix, GLKMathDegreesToRadians(0), 1, 0, 0);
modelViewMatrix = GLKMatrix4Rotate(modelViewMatrix, GLKMathDegreesToRadians(_rotation), 0, 1, 0);
self.effect.transform.modelviewMatrix = modelViewMatrix;
}
キューブを増やす方法を教えてもらえますか? 前もって感謝します。