Examples of glColorMaterial()


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

      // Lighting, Coloring
      gl.glEnable(GL.GL_LIGHTING);
    gl.glEnable(GL.GL_BLEND);
      gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
      gl.glEnable(GL.GL_COLOR_MATERIAL);
      gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE);
      gl.glShadeModel(GL.GL_SMOOTH);

    // Texturing
      gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE);
   
View Full Code Here

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

      // Lighting, Coloring
      gl.glEnable(GL.GL_LIGHTING);
    gl.glEnable(GL.GL_BLEND);
      gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
      gl.glEnable(GL.GL_COLOR_MATERIAL);
      gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE);
      gl.glShadeModel(GL.GL_SMOOTH);

      // Anti-Aliasing (Polygon antialiasing causes problems on most graphics cards, don't use it!)
//    FloatBuffer buf = FloatBuffer.allocate(2);
//    gl.glGetFloatv(gl.GL_POINT_SIZE_RANGE, buf);
View Full Code Here

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

    // may look too bright, and large objects will look flat.
    gl.glEnable(GL.GL_NORMALIZE);

    // Coloring

    gl.glColorMaterial(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE);
    gl.glEnable(GL.GL_COLOR_MATERIAL);

    // Remove back-face rendering

    gl.glCullFace(GL.GL_BACK);
View Full Code Here

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

        ToolsLight.setAmbientLight(gl, new float[]{ambientR/255, ambientG/255, anbientB/255, ambientA/255});
       
        //This means that glMaterial will control the polygon's specular and emission colours
        //and the ambient and diffuse will both be set using glColor.
//        gl.glColorMaterial(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE);
        gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE);
//        gl.glColorMaterial(GL.GL_FRONT, GL.GL_DIFFUSE);
       
        //Enable color material
        gl.glEnable(GL.GL_COLOR_MATERIAL);
View Full Code Here

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

      //Set default ambient lightning for all objs
      setAmbientLight(gl, new float[]{0.2f, 0.2f, 0.2f,1});
     
      //This means that glMaterial will control the polygon's specular and emission colours
      //and the ambient and diffuse will both be set using glColor.
      gl.glColorMaterial(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE);
//      gl.glColorMaterial(GL.GL_FRONT, GL.GL_DIFFUSE);
     
      //Enable color material
      gl.glEnable(GL.GL_COLOR_MATERIAL);
View Full Code Here

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

            }

            // Enable rescale normal
            gl.glEnable(GL2.GL_RESCALE_NORMAL);

            gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2.GL_DIFFUSE);
            gl.glDepthFunc(GL.GL_LEQUAL);
            gl.glEnable(GL2.GL_COLOR_MATERIAL);

            /*
            OpenGL specs:
View Full Code Here

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

    GL2 gl = context(ctx).getGL().getGL2();

        gl.glMaterialf(GL.GL_FRONT_AND_BACK, GL2.GL_SHININESS, shininess);
        switch (colorTarget) {
            case Material.DIFFUSE:
                gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2.GL_DIFFUSE);
                break;
            case Material.AMBIENT:
                gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2.GL_AMBIENT);
                break;
            case Material.EMISSIVE:
View Full Code Here

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

        switch (colorTarget) {
            case Material.DIFFUSE:
                gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2.GL_DIFFUSE);
                break;
            case Material.AMBIENT:
                gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2.GL_AMBIENT);
                break;
            case Material.EMISSIVE:
                gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2.GL_EMISSION);
                break;
            case Material.SPECULAR:
View Full Code Here

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

                break;
            case Material.AMBIENT:
                gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2.GL_AMBIENT);
                break;
            case Material.EMISSIVE:
                gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2.GL_EMISSION);
                break;
            case Material.SPECULAR:
                gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2.GL_SPECULAR);
                break;
            case Material.AMBIENT_AND_DIFFUSE:
View Full Code Here

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

                break;
            case Material.EMISSIVE:
                gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2.GL_EMISSION);
                break;
            case Material.SPECULAR:
                gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2.GL_SPECULAR);
                break;
            case Material.AMBIENT_AND_DIFFUSE:
                gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2.GL_AMBIENT_AND_DIFFUSE);
                break;
        }
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.