Package javax.media.opengl

Examples of javax.media.opengl.GL.glDepthFunc()


        //-----------------------------------------SetUp OGL-----------------------------------------------//
        //gl.glShadeModel(GL.GL_SMOOTH);              // Enable Smooth Shading
        gl.glClearColor(0, 0, 0, 1);    // Black Background
        gl.glClearDepth(1.0f);                      // Depth Buffer Setup
        gl.glEnable(GL.GL_DEPTH_TEST);              // Enables Depth Testing
        gl.glDepthFunc(GL.GL_LEQUAL);                // The Type Of Depth Testing To Do
       
        gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST)// Really Nice Perspective Calculations
        gl.glEnable(GL.GL_TEXTURE_2D);
        //gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
View Full Code Here


   
    final GL gl = glDrawable.getGL();
    gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

    gl.glClearDepth(1.0);                  //Enable Clearing of the Depth buffer
    gl.glDepthFunc(GL.GL_LEQUAL);              //Type of Depth test
    gl.glEnable(GL.GL_DEPTH_TEST);              //Enable Depth Testing

    gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);

    // light
View Full Code Here

    private static void applyFunction(final int depthFunc, final ZBufferStateRecord record) {
        final GL gl = GLU.getCurrentGL();

        if (depthFunc != record.depthFunc || !record.isValid()) {
            gl.glDepthFunc(depthFunc);
            record.depthFunc = depthFunc;
        }
    }

    private static void enableWrite(final boolean enable, final ZBufferStateRecord record) {
View Full Code Here

    gl.glShadeModel(GL.GL_SMOOTH);                     // Enable Smooth Shading
    gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);          // Black Background
    gl.glClearDepth(1.0f);                            // Depth Buffer Setup
    gl.glEnable(GL.GL_DEPTH_TEST);              // Enables Depth Testing
    gl.glDepthFunc(GL.GL_LEQUAL);              // The Type Of Depth Testing To Do

    gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_FASTEST);

    // Lighting
View Full Code Here

   */
  public static void beginDrawOnTopStayOnScreen(PApplet pa){
    switch (MT4jSettings.getInstance().getRendererMode()) {
    case MT4jSettings.OPENGL_MODE:
      GL gl = ((PGraphicsOpenGL)pa.g).gl;
      gl.glDepthFunc(javax.media.opengl.GL.GL_ALWAYS); //turn off Z buffering
      //reset to the default camera
      pa.camera();
      break;
    case MT4jSettings.P3D_MODE:
      for(int i=0;i<((PGraphics3D)pa.g).zbuffer.length;i++){
View Full Code Here

   */
  public static void endDrawOnTopStayOnScreen(PApplet pa, Icamera camera){
    switch (MT4jSettings.getInstance().getRendererMode()) {
    case MT4jSettings.OPENGL_MODE:
      GL gl = ((PGraphicsOpenGL)pa.g).gl;
      gl.glDepthFunc(GL.GL_LEQUAL); //This is used by standart processing..
      //Change camera back to current 3d camera
      camera.update();
      break;
    case MT4jSettings.P3D_MODE:
      camera.update();
View Full Code Here

    switch (MT4jSettings.getInstance().getRendererMode()) {
    case MT4jSettings.OPENGL_MODE:
//      GL gl = ((PGraphicsOpenGL)pa.g).gl;
      GL gl = ((PGraphicsOpenGL)g).gl;
      gl.glPushAttrib(GL.GL_DEPTH_BUFFER_BIT);//FIXME TEST
      gl.glDepthFunc(javax.media.opengl.GL.GL_ALWAYS); //turn off Z buffering
      break;
    case MT4jSettings.P3D_MODE:
//      /*
//      for(int i=0;i<((PGraphics3D)pa.g).zbuffer.length;i++){
//        ((PGraphics3D)pa.g).zbuffer[i]=Float.MAX_VALUE;
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.