GLKViewControllerサブクラスに次のようなコードがあります。
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch * touch = [touches anyObject];
CGPoint point = [touch locationInView:self.view];
NSLog(@"touch has begun!: %f %f",point.x,point.y);
float xw = [self.view bounds].size.width;
float yw = [self.view bounds].size.height;
NSLog(@"touch -- %f %f", point.x / xw, point.y / yw);
}
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return UIInterfaceOrientationLandscapeRight == toInterfaceOrientation;
}
さらに、「iPhone / iPodの展開情報」で、サポートされている唯一のデバイスの向きを「LandscapeRight」に設定しました。
上記のコードで実行してテストすると、左上隅が(0,0)のように見えます。ただし、これに似た別のテストプロジェクトがあり、(0,0)ポイントが左下隅にありました。
正確には、座標系の方向を決定するものは何ですか?(0,0)ポイントを左上隅ではなく左下隅にしたい場合、どうすればよいですか?