anguloHorizontal += 360.0f;
}
}
public void atualizarPerspectiva(GL gl) {
Tuple3f v = new Tuple3f();
float modelViewMatrix[] = new float[16];
gl.glRotatef(anguloHorizontal, 0.0f, 1.0f, 0.0f);
gl.glRotatef(anguloVertical, 1.0f, 0.0f, 0.0f);
gl.glGetFloatv(GL.GL_MODELVIEW_MATRIX, modelViewMatrix, 0);
direcaoCamera.set(modelViewMatrix[8], modelViewMatrix[9], -modelViewMatrix[10]);
gl.glLoadIdentity();
gl.glRotatef(anguloVertical, 1.0f, 0.0f, 0.0f);
gl.glRotatef(anguloHorizontal, 0.0f, 1.0f, 0.0f);
v.scale(velocidade, direcaoCamera);
posicaoCamera.add(v);
gl.glTranslatef(-posicaoCamera.getX(), -posicaoCamera.getY(), -posicaoCamera.getZ());
}