public void orthof(float left, float right, float bottom, float top, float zNear, float zFar) { orthoproj[0] = left; orthoproj[1] = right; orthoproj[2] = bottom; orthoproj[3] = top; pvmat.glMatrixMode(GL2.GL_PROJECTION); pvmat.glLoadIdentity(); pvmat.glOrthof(left, right, bottom, top, zNear, zFar); pvmat.update(); }
// Unused routines public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) { System.err.println("reshape .."); final GL2ES2 gl = glad.getGL().getGL2ES2(); pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION); pmvMatrix.glLoadIdentity(); // pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f); pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 10.0f); pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW); pmvMatrix.glLoadIdentity(); st.useProgram(gl, true); st.uniform(gl, pmvMatrixUniform); st.useProgram(gl, false); }
@Override public void reshape( final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { final GL2ES2 gl = drawable.getGL().getGL2ES2(); // Clear background to white gl.glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); if (null != st) { pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION); pmvMatrix.glLoadIdentity(); pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 10.0f); pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW); pmvMatrix.glLoadIdentity(); st.useProgram(gl, true); st.uniform(gl, pmvMatrixUniform); st.useProgram(gl, false); } }
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { GL2ES2 gl = drawable.getGL().getGL2ES2(); st.glUseProgram(gl, true); // Set location in front of camera pmvMatrix.glMatrixMode(pmvMatrix.GL_PROJECTION); pmvMatrix.glLoadIdentity(); pmvMatrix.glOrthof(0f, 1.0f, 0.0f, 1.0f, 1.0f, 100.0f); pmvMatrix.glMatrixMode(pmvMatrix.GL_MODELVIEW); pmvMatrix.glLoadIdentity(); pmvMatrix.glTranslatef(0, 0, -10); GLUniformData ud = st.getUniform("mgl_PMVMatrix"); if (null != ud) { // same data object st.glUniform(gl, ud); } st.glUseProgram(gl, false); }