Help with creating sponge out of cube

Hi Everyone,

I’m required to generate menger sponge in OpenGL 3.1 since it not longer supports GL_QUADS how can I subdivide triangle to get the look of menger sponge.

http://en.wikipedia.org/wiki/Menger_sponge

Any help would be appreciated

Just draw two triangles where you would have drawn a QUAD. Or just use a compatibility profile.

Hi Alfonso,

Thanks for the quick response. I have already generated the cube but don’t know how to make it look like menger sponge

Could you also explain what compatibility profile is and how can we include it

If you are on Windows, and you will be using Win32 code or MFC code or something of the sort, you check if WGL_ARB_create_context is present like this guy is doing.
http://www.opengl.org/wiki/Tutorial:_OpenGL_3.1_The_First_Triangle_(C%2B%2B/Win)

and instead of WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, you use WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB.

Then everything from GL 1.0 up to GL 3.1 will be available to you.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.