gluPerspective = Blank Screen, gluOrtho2D = Fine

Bascially my friend wants me to do graphics for games he makes with Java, and he refuses to use C++(only because of pointers), so I checked out JOGL and I don’t want Orthopathic Projections obviously if I want a 3D game, so I tested it out with gluPerspective() and when I run it, the window its just blank and doens’t clear it with the glClearColor(); When I use gluOrtho2D its completley fine, I’m able to see the simple box I made. I don’t know whats going on! Help ??? ?

“Bascially my friend wants me to do graphics for games he makes with Java, and he refuses to use C++(only because of pointers)” - your friends are wright. Java is enough fast to use it to game projects. and it’s a great language.

By the way, post some code to the forum to be able to help.

You may wanna take a look at the OpenGL links/tutorials at:
www.waterlogic.com.sg/opengl

nice collection - it’s wrong in only having jogl as a java binding, but otherwise nice :wink:

public void reshape(
                     GLDrawable gld,
                     int x,
                     int y,
                     int width,
                     int height
                   ) {
		GL gl = gld.getGL();
		GLU glu = gld.getGLU();
		
		gl.glMatrixMode(gl.GL_PROJECTION);
		gl.glLoadIdentity();
		
		gl.glViewport(0,0,width,height);
		glu.gluPerspective(60.0f,(float)width/(float)height,0.1f,100.0f);
		//gl.glOrtho(-40/3.0f,40/3.0f,-10,10,-10,10);
		
		gl.glMatrixMode(gl.GL_MODELVIEW);
		gl.glLoadIdentity();
	}

Its basically just what I’ve been doing in C++, the same exact function. If I switch Ortho and Perspective, it will work then not work.