I have a simple application that displays a 3D cube that rotates on all axes, and a camera controlled via mouse that allows you to adjust the angle you're looking at the cube.
The entire application works exactly as I want when I use glOrtho, but once I change it to gluPerspective I only get a black screen.
Here is my method to initialize openGL:
public void initializeOpenGL()
gluPerspective(45.0f, ((float)WIDTH) / ((float)HEIGHT), 0.01f, 500f);
//glOrtho(0, 640, 480, 0, 600, -1); //displays everything correctly
public void begin()
float degrees = 0;
moveCamera(); //calculates the changes in mouse position
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
camera.lookThrough(); //applies the changes
I created an image displaying where the camera looks: http://i.imgur.com/9NVSyqj.png As you can see the camera looks along the -z axis
-> you should try translating the quad to something like:
glTranslatef(0,0, -10f );
Instead of moving the quad to the middle of the Display you move it half the size of the Display in the nowhere of your Landscape
SHORT VERSION: Gist: https://gist.github.com/Chronove/11da12b2635bfc040981