Reputation: 1972
I want to change the origin of my OpenGL origin. Pictures will explain:
This is how it is now:
This is how I want it:
Current code
gl.glViewport(0, 0, width, height);
gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glLoadIdentity();
GLU.gluPerspective(gl, 45.0f,
(float)width / (float)height, 0.1f, 100.0f);
gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glLoadIdentity();
Upvotes: 0
Views: 1836
Reputation: 5211
try
gl.glTranslatef (0, height / 2.0, 0);
after the second glLoadIdentity call
(+ or - height)
Upvotes: 1