Examples of glDepthFunc()


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

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

   
    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

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

    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

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

    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

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

   */
  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

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

   */
  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

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

    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

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

            gl.glAlphaFunc(GL2.GL_GREATER, 0.001f);

            // Adjust depth of image to bring it slightly forward
            double depth = screenPoint.z - (8d * 0.00048875809d);
            depth = depth < 0d ? 0d : (depth > 1d ? 1d : depth);
            gl.glDepthFunc(GL.GL_LESS);
            gl.glDepthRange(depth, depth);

            // The image is drawn using a translated and scaled unit quad.
            // Translate to screen point and adjust to align hot spot.
            osh.pushModelviewIdentity(gl);
View Full Code Here

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

    {
        GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.

        if ((!dc.isDeepPickingEnabled()))
            gl.glEnable(GL.GL_DEPTH_TEST);
        gl.glDepthFunc(GL.GL_LEQUAL);
        gl.glDepthMask(true);

        try
        {
            dc.getView().pushReferenceCenter(dc, this.placePoint); // draw relative to the place point
View Full Code Here

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

            gl.glAlphaFunc(GL2.GL_GREATER, 0.001f);

            // Adjust depth of point to bring it slightly forward
            double depth = this.screenPoint.z - (8d * 0.00048875809d);
            depth = depth < 0d ? 0d : (depth > 1d ? 1d : depth);
            gl.glDepthFunc(GL.GL_LESS);
            gl.glDepthRange(depth, depth);

            gl.glBegin(GL2.GL_POINTS);
            gl.glVertex3d(this.screenPoint.x, this.screenPoint.y, 0);
            gl.glEnd();
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.