Skip to content

Instantly share code, notes, and snippets.

@Pwootage
Created December 2, 2011 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pwootage/1421985 to your computer and use it in GitHub Desktop.
Save Pwootage/1421985 to your computer and use it in GitHub Desktop.
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
Vector3 pos = game.getPlayer().getPos();
Vector3 look = game.getPlayer().getLookVec();
Vector3 eye = pos.add(look);
gluLookAt(eye.getX(), eye.getY(), eye.getZ(), pos.getX(), pos.getY(), pos.getZ(), 0, 0, 1);
glTranslatef(0, 0, -5);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
glPushMatrix();
game.getWorld().render();
glPopMatrix();
Display.update();
Display.sync(game.getMainWindow().VSYNC);
checkForErrors();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment