All I’m trying to do is display a 3D cube with Ortho and I have no idea but nothing appears. although everything is in range O.o it has confused me to the next level to the point of > 9000
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.glu.GLU;
public class shadows{
public static double angle = 0;
public static void init(){
try {
Display.create();
Display.setDisplayMode(new DisplayMode(800, 600));
Display.setTitle("");
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(-10, 10, -10, 10, 10, -10);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
GL11.glEnable(GL11.GL_DEPTH_TEST);
} catch (LWJGLException e) {
e.printStackTrace();
}
}
public static void renderLoop(){
while(!Display.isCloseRequested()){
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
GL11.glClearColor(0, 0, 1, 1);
GL11.glLoadIdentity();
GL11.glColor3d(1, 1, 1);
GL11.glBegin(GL11.GL_QUADS);
// front
GL11.glVertex3f(-1, -1, 1);
GL11.glVertex3f(-1, 1, 1);
GL11.glVertex3f( 1, 1, 1);
GL11.glVertex3f( 1, -1, 1);
//back
GL11.glVertex3f(-1, -1, -1);
GL11.glVertex3f(-1, 1, -1);
GL11.glVertex3f( 1, 1, -1);
GL11.glVertex3f( 1, -1, -1);
// right
GL11.glVertex3f( 1, -1, 1);
GL11.glVertex3f( 1, 1, 1);
GL11.glVertex3f( 1, 1,-1);
GL11.glVertex3f( 1, -1,-1);
// left
GL11.glVertex3f(-1, -1, 1);
GL11.glVertex3f(-1, 1, 1);
GL11.glVertex3f(-1, 1,-1);
GL11.glVertex3f(-1, -1,-1);
// bottom
GL11.glVertex3f(-1, -1, 1);
GL11.glVertex3f(-1, -1,-1);
GL11.glVertex3f( 1, -1,-1);
GL11.glVertex3f( 1, -1, 1);
// Top
GL11.glVertex3f(-1, 1, 1);
GL11.glVertex3f(-1, 1,-1);
GL11.glVertex3f( 1, 1,-1);
GL11.glVertex3f( 1, 1, 1);
GL11.glEnd();
Display.update();
Display.sync(30);
System.out.println("Frame Rendered");
}
cleanup();
}
public static void cleanup(){
Display.destroy();
}
public static void main(String[] args){
init();
renderLoop();
System.exit(0);
}
}