Examples of JVoxGL


Examples of de.lv.jvoxgl.JVoxGL

 
  public static void main(String[] args){
    Log.setLogLevel(Log.LEVEL_DEBUG);
   
    world = new World(16, 256, 16);
    JVoxGL voxgl = new JVoxGL(world, 1024,768);
    JVoxGLTest.createChunk(world);
   
    ShaderProgram shader = new ShaderProgram(2);
    try {
      shader.loadShader(0, GL20.GL_VERTEX_SHADER, new File("vertex.glsl"));
      shader.loadShader(1, GL20.GL_FRAGMENT_SHADER, new File("fragment.glsl"));
    } catch (IOException e) {
      e.printStackTrace();
    }
   
    HashMap<Integer, String> att = new HashMap<Integer, String>();
    att.put(0, "in_Position");
    shader.create(att);
   
    world.setShader(shader);
   
    cam = new FPSCameraController(0, -30, -40);
    Mouse.setGrabbed(true);
   
    GL11.glTranslatef(0, -30, -40);
    while(!Display.isCloseRequested() && !Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)){
      GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
     
      JVoxGLTest.updateCam();
     
      voxgl.render();
     
      Display.sync(60);
      Display.update();
    }
   
    voxgl.destroy();
    Display.destroy();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.