using openGL to produce a mesh cube

I want to use openGl to draw a mesh cube whose density can be controled!Please give me some method.Algorithmic language describing will be better.Wait for you advice.God bless you and me!

OpenGL draws triangles, not densities. If you’re talking about a solid cube, the density is not a property that can be drawn.

For a cube that represents atmosphere or smoke or something, it depends on how you intend to draw it. There are several methods for volumetric rendering available to you.

What I want to complete is that.Do you have some good idea? I’d be most grateful