Trying 3d for the first time - How should I initGL()?

I made a simple cube, except it doesn’t have a back. Or a right side. Or a left side. Or a bottom. Ok, it’s not really a cube, but it has a front and top so that I can test depth! Anyways, I placed it so that the front is at position (0, 0, 0) but I can’t see it, and I think it has to do with my initGL() function:

protected void initGL() {
	int width = display_parent.getWidth();
	int height = display_parent.getHeight();
	GL11.glEnable(GL11.GL_TEXTURE_2D);'
              
        GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);          
        
        // enable alpha blending
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        
        GL11.glViewport(0,0,width,height);
	GL11.glMatrixMode(GL11.GL_MODELVIEW);

	GL11.glMatrixMode(GL11.GL_PROJECTION);
	GL11.glLoadIdentity();
	GL11.glOrtho(0, width, 0, height, 0, height);
	GL11.glMatrixMode(GL11.GL_MODELVIEW);
}

Am I doing something wrong? It’s 2:00 AM, so I probably am. Off to bed. Thanks in advance!

your cube is probably clipped due to false far/near planes. Also having zero in the middle of the screen helps.
try:


GL11.glOrtho( -width/2, width/2, -height/2, height/2, -height/2, height/2 )

for starters

Thanks for the help. Shiny medal for you! I still can’t see my cube though. :frowning: Here’s the block class:
EDIT: Wait, it worked! Thanks a lot!