Examples of GLU


Examples of javax.media.opengl.glu.GLU

    public void init(GLAutoDrawable drawable) {
        this.fpsCounter = new FPSCounter(drawable, new Font("SansSerif", Font.BOLD, 12));

        // Parse random gcode file and generate something to draw.
        GL2 gl = drawable.getGL().getGL2();      // get the OpenGL graphics context
        glu = new GLU();                         // get GL Utilities
        gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // set background (clear) color
        gl.glClearDepth(1.0f);      // set clear depth value to farthest
        gl.glEnable(GL_DEPTH_TEST); // enables depth testing
        gl.glDepthFunc(GL_LEQUAL)// the type of depth test to do
        gl.glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // best perspective correction
View Full Code Here

Examples of javax.media.opengl.glu.GLU

     */
    @Override
    public void init(GLAutoDrawable drawable) {
        GL2 gl = drawable.getGL().getGL2();
       
        glu = new GLU();
        gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
        gl.glClearDepth(1.0f);
        gl.glEnable(GL_DEPTH_TEST); // Enables depth testing
        gl.glDepthFunc(GL_LEQUAL); // the type of depth test to do
        gl.glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // best perspective coorection
View Full Code Here

Examples of javax.media.opengl.glu.GLU

        *
        * @param p the processing context
        */
       public GluTrianglulator(PApplet p) {
         this.p = p;
           this.glu = new GLU();
          
           tesselator = glu.gluNewTess();
          
           glu.gluTessCallback(tesselator, GLU.GLU_TESS_VERTEX, this);// glVertex3dv);
           glu.gluTessCallback(tesselator, GLU.GLU_TESS_BEGIN, this);// beginCallback);
View Full Code Here

Examples of javax.media.opengl.glu.GLU

      ){
        //deprectated in opengl 3.0 -will always create mipmaps automatically if lvl 0 changes
//        gl.glTexParameteri( textureTarget, GL.GL_GENERATE_MIPMAP, GL.GL_TRUE );
        if (this.forcedRectMipMaps){
          //Resizes NPOT textures to POT
          GLU glu = ((PGraphicsOpenGL)this.parent.g).glu;
          glu.gluBuild2DMipmaps(textureTarget, internalFormat, this.width, this.height, glFormat, type, buffer);
        }else{
          if (this.fboSupported){ //Naive check if glGenerateMipmapEXT command is supported
            gl.glTexSubImage2D(textureTarget, 0, 0, 0, this.width, this.height, glFormat, type, buffer);
            gl.glGenerateMipmapEXT(textureTarget)//newer OpenGL 3.x method of creating mip maps //TODO problems on ATI? use gl.glEnable(textureTarget) first?
          }else{
            //Old school software method, will resize a NPOT texture to a POT texture
            GLU glu = ((PGraphicsOpenGL)this.parent.g).glu;
            glu.gluBuild2DMipmaps(textureTarget, internalFormat, this.width, this.height, glFormat, type, buffer);
          }
        }
      }
      else{
        gl.glTexSubImage2D(textureTarget, 0, 0, 0, width, height, glFormat, type, buffer); //ORG
View Full Code Here

Examples of javax.media.opengl.glu.GLU

      double[] mousePosArr = new double[4];
     
      try{
      PGraphicsOpenGL pgl = ((PGraphicsOpenGL)applet.g);
      GL gl = pgl.beginGL()
      GLU glu = pgl.glu;
     
          gl.glGetIntegerv(GL.GL_VIEWPORT, viewport, 0);
          gl.glGetDoublev(GL.GL_PROJECTION_MATRIX, proj, 0);
          gl.glGetDoublev(GL.GL_MODELVIEW_MATRIX, model, 0);
         
          /*
          System.out.println("OpenGL ProjectionMatrix: ");
          for (int i = 0; i < proj.length; i++) {
            double p = proj[i];
            System.out.print(p + ", ");
            //if (i%4 == 0 && i==3)
            if (i==3 || i== 7 || i== 11 || i==15) {
              System.out.println();
            }
            }
          */
         
          /*
          System.out.println("OpenGL ModelviewMatrix: ");
          for (int i = 0; i < model.length; i++) {
            double p = model[i];
            System.out.print(p + ", ");
            //if (i%4 == 0 && i==3)
            if (i==3 || i== 7 || i== 11 || i==15) {
              System.out.println();
            }
            }
          System.out.println();
          System.out.println("\n");
          */
         
          /*
          fbUn.clear();
          gl.glReadPixels((int)screenX, applet.height - (int)screenY, 1, 1, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, fbUn);
          fbUn.rewind();
          glu.gluUnProject((double)screenX, applet.height - (double)screenY, (double)fbUn.get(0), model, 0, proj, 0, viewport, 0, mousePosArr, 0);
          */
         
          //FIXME test not using glReadpixel to get the depth at the location
          //instead we have to build a ray with the result, from the camera location going through the resulst and check for hits ourselves
          glu.gluUnProject((double)screenX, applet.height - (double)screenY, 0, model, 0, proj, 0, viewport, 0, mousePosArr, 0);
        pgl.endGL();
       
        returnVect = new Vector3D((float)mousePosArr[0], (float)mousePosArr[1], (float)mousePosArr[2]);
      }catch(Exception e){
        e.printStackTrace();
View Full Code Here

Examples of javax.media.opengl.glu.GLU

    switch (MT4jSettings.getInstance().getRendererMode()) {
    case MT4jSettings.OPENGL_MODE:
      try{
        PGraphicsOpenGL pgl = ((PGraphicsOpenGL)applet.g);
        GL gl   = pgl.beginGL()
        GLU glu = pgl.glu;
        Vector3D returnVect = projectGL(gl, glu, point);
        pgl.endGL();
        return returnVect;
      }catch(Exception e){
        e.printStackTrace();
View Full Code Here

Examples of javax.media.opengl.glu.GLU

      GLUT.BITMAP_TIMES_ROMAN_24 //
  };

  public JOGLGraphicsAdapter(GL gl) {
    this.gl = gl;
    glu = new GLU();
    glut = new GLUT();
    try {
      loadGLTextures(gl);
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

Examples of javax.media.opengl.glu.GLU

  public JOGLRefresher(SWTOpenGLJOGLNanoGraphPanel panel, GLCanvas canvas, Display display, GLContext context) {
    this.panel = panel;
    this.canvas = canvas;
    this.display = display;
    this.context = context;
    this.glu = new GLU();
    gl = context.getGL();
  }
View Full Code Here

Examples of javax.media.opengl.glu.GLU

                context.makeCurrent();
                gl = context.getGL();
                gl.glViewport(0, 0, bounds.width, bounds.height);
                gl.glMatrixMode(GL.GL_PROJECTION);
                gl.glLoadIdentity();
                glu = new GLU();
                glu.gluPerspective(45.0f, fAspect, 0.5f, 400.0f);
                gl.glMatrixMode(GL.GL_MODELVIEW);
                gl.glLoadIdentity();
                context.release();
            }
View Full Code Here

Examples of net.java.games.jogl.GLU

       
       
       
       
        GL gl = drawable.getGL();
        GLU glu = drawable.getGLU();
        gl.glGenTextures(1, textures);
        gl.glBindTexture(GL.GL_TEXTURE_2D, textures[0]);
        gl.glDisable(GL.GL_DEPTH_TEST);
        gl.glDisable(GL.GL_LIGHTING);
        gl.glEnable(GL.GL_TEXTURE_2D);
        //gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);

        gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_REPEAT);
        gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_REPEAT);
        gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
        gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);

        gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, width, height, 0,  GL.GL_RGBA, GL.GL_UNSIGNED_INT_8_8_8_8, (char[])null);

        //System.out.println("time :: " + (System.currentTimeMillis() - time)); 
        gl.glClear(GL.GL_COLOR_BUFFER_BIT);
        gl.glMatrixMode(GL.GL_PROJECTION);   
        gl.glLoadIdentity();              
        glu.gluOrtho2D(-1.0, 1.0, -1.0, 1.0);
       
        cgContext = CgGL.cgCreateContext();
        int errorCg = CgGL.cgGetError();
        System.out.println("cgCreateContext: "+CgGL.cgGetErrorString(errorCg));
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.