Package javax.media.opengl

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


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

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

        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

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

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.