problems with perspective

Hi there,
First of all I should say that I’m pretty new to OpenGL and JOGL, so the problems I’m experiencing are probably familiar to anyone who’s not a novice.
I’ve been struggiling with getting accurate perspectives with diminuation of size. Basically, If I try to move an object in the negative z direction (just for the sake of an example) , rather than getting smaller, it will maintain it’s dimensions until it leaves the clipping volume, at which point it gradually gets clipped. I would appreciate some basic instruction on the matter. The following lines of code are a simplified version of what I had thought would fix the problem…
this is in display():

        gl.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT);
        gl.glMatrixMode(gl.GL_PROJECTION);
        gl.glLoadIdentity();      
        glu.gluPerspective(15.0f, 1.6f, -1.0, 10.0);
        gl.glMatrixMode(gl.GL_MODELVIEW); 
        gl.glLoadIdentity();
        gl.translate(some coordinates);
        glut.glutWireSphere(glu, 0.5d, 12, 8 );

Do I need to do anything else in order to activate an accurate rendition of perspective? Is there anything I might not be doing that I should be doing? Any help would be greatly appreciated.
Thanks
Sam

[quote] gl.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT);
gl.glMatrixMode(gl.GL_PROJECTION);
gl.glLoadIdentity();
glu.gluPerspective(15.0f, 1.6f, -1.0, 10.0);
gl.glMatrixMode(gl.GL_MODELVIEW);
gl.glLoadIdentity();
gl.translate(some coordinates);
glut.glutWireSphere(glu, 0.5d, 12, 8 );
[/quote]
Theres a couple of things wrong with this. Firstly, and perhaps most importantly, glPerspective can’t take a negative value as the zNear value. Has to be >0. Generally you’d pick your zNear value depending on what your zFar value is. I generally go for something about between a 10th and 100th of the zFar value depending on the scene and where my ‘camera’ is. This will minimize artifacting in the depth buffer for similar z-values.

Secondly, your FOV is 15 degrees. As your FOV tends toward infinity , the perspective projection will tend toward an orthographic projection, so a nice round 45 or 60 degrees will give you more a pronounced perspective effect.

these are my default values in my camera class:
DEFAULT_FOV = 64f;
FAR_CLIP = 1000f;
NEAR_CLIP = 10f;

with the aspect set to whatever the aspect ratio of the viewport is.

D.

Hey,
That fixed my problem. Thank you very much for the thoughtful response. Very helpful.
Take care