iphoneopengl-esiphone-sdk-3.1

Background problem of opengl 3d object over iphone camera view


I'm loading opengl 3d objects over the iphone camera view. When opengl view is loaded it's loading with a opengl 3d object with black background. The black background color will block the camera view.I just want to clear background color of opengl view so that I could load only the 3d object to the camera view. I had tried

glclearcolor(1.0,1.0,1.0,0.0);
but no change to background color. I had also tried to clear background color opengl view using
[glview setbackgroundColor:[UIColor clearColor]];
. No change in back ground color.

Can any one help me with this stuff ?

I'm new to opengl.

Thanks in advance


Solution

  • You need to call glClear() after glClearColor(). glClearColor() only sets the clear values for the color buffer.