0

I have C# windows form application. The form has a background image and few controls in it. In one area of the form, i want to render a 3D model. 3D model can be rotated, translated.

Now the problem is background of 3D model is black. Here, instead of black background, i need the background of openGL component to be transparent, such that form's background is visible. How do i achieve this?

Used SharpGL library for all openGL calls.

genpfault
  • 51,148
  • 11
  • 85
  • 139
user883822
  • 41
  • 6
  • possible duplicate of [How to make an OpenGL rendering context with transparent background?](http://stackoverflow.com/questions/4052940/how-to-make-an-opengl-rendering-context-with-transparent-background) – MuertoExcobito Jun 10 '15 at 11:18
  • MuertoExcobito : Link you gave talks about the object floating on the screen. But what i required is : object still in form whose background is transparent. Hence when form is moved, object is still within the form. – user883822 Jun 10 '15 at 12:25
  • Have you tried setting the clearColor alpha to zero? – Nader Jun 10 '15 at 15:40
  • why not draw the backround image in OpenGL after clearing buffers? – Spektre Jun 11 '15 at 06:33
  • @Nader : Yes, i tried. But still no answer. – user883822 Jun 11 '15 at 07:20
  • @Spektre : 3D model is on the form. user has an option to change the background of the form. In this case, having a fixed background image for OpenGl will not work in my case... Any other clues? – user883822 Jun 11 '15 at 07:21
  • you mis understood you copy the actual background image to some texture and use that as background in opengl draw too – Spektre Jun 11 '15 at 08:26
  • @Spektre... thanks for the clue... Now i get it... but i am a newbie in openGl and any pointers / logic would be really really helpful... – user883822 Jun 11 '15 at 09:27

0 Answers0