2014-01-28 63 views
0

我必須開發一些氣泡,其中將包含主背景圖像的一部分。 1我從不使用OpenGL ES2。 你知道一些書或書能幫助我理解openGl嗎?如何在OpenGL iOS中做泡泡?

我2.How可以做截圖在OpenGL的背景圖像?

3.How可我設置在球體裏面的一些形象?

回答

1

1)嘗試一些例子來開始喜歡GLPaint

2)可以使一個UIView的截圖:

+ (UIImage *)imageFromView:(UIView *)view { 
    UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0); 
    [view.layer renderInContext:UIGraphicsGetCurrentContext()]; 
    UIImage * img = UIGraphicsGetImageFromCurrentImageContext(); 
    UIGraphicsEndImageContext(); 
    return img; 
} 

3)你需要生成和load a texture from image。然後創建正確的vertex coordinates並繪製它們。或者,您可以創建一個可以完成所有操作並僅繪製一個方形的fragment shader