I am trying to render a square with a beveled edge so that the light source will give a raised 3D look. I have this working at the moment, but my problem is when I try translate the square to the upper left or lower right of the window, the “perspective” kicks in and makes the face of the square move to the upper left or lower right depending on the location. This effect reflects the real world very nicely, but I don’t want this. I want the square to have a “top down” look no matter where I place the square. In other words, the beveled edges should all have the same uniform spacing all around the square. Below is my attempt to show the square using text. Notice that the inner part of the square is what I call the “face”.
\ / ----- / |
From what I have read, I think I am supposed to use glOrtho to render things without perspective, but I don’t know how to translate the gluPerspective method into glOrtho.
Here is the code for the reshape method when the window gets resized…
gl.glViewport(0, 0, width, height);
gl.glMatrixMode(GL_PROJECTION);
gl.glLoadIdentity();
glu.gluPerspective(45.0f, width / height, 0.1f, 100.0f);
gl.glMatrixMode(GL_MODELVIEW);
gl.glLoadIdentity();
Any thoughts?
[This message has been edited by stout (edited 08-25-2003).]