Examples of GLTexture


Examples of codeanticode.glgraphics.GLTexture

           
            PImage faceImage = parent.loadImage(folder + "/" +  filename.replaceAll(".ana", ".jpg"));
           
            logger.info("loading image: " + filename);
           
            texturePool.add(new GLTexture(parent));
           
            texturePool.get(texturePool.size() - 1).putPixelsIntoTexture(faceImage, values[0], values[1], values[2], values[3]);
         
            logger.info("texture added: " + filename);
           
View Full Code Here

Examples of codeanticode.glgraphics.GLTexture

    MONO_Y  = (int) config.getParameter("monoY") ;
   
   
    MONOLITO_RENDERER = new MonolitoRenderer(this, MONO_W, MONO_H);
   
    MONOLITO_TEXTURE = new GLTexture(this, MONO_W, MONO_H);
    MONOLITO = new GLTextureWindow(this, MONO_X, MONO_Y, MONO_W, MONO_H);
    MONOLITO.setTexture(MONOLITO_TEXTURE);
    MONOLITO.init();
   
    /////////////////////////////////////////////////////////////
View Full Code Here

Examples of codeanticode.glgraphics.GLTexture

  public Grid(PApplet parent, int w, int h){
   
    super(parent, w, h);
    // TODO implementar un mecanismo que me permita renderear en la textura
    // que despues uso para la grilla
    texture = new GLTexture(parent, parent.dataPath("textura_11.png"));
  }
View Full Code Here

Examples of codeanticode.glgraphics.GLTexture

    // OUTPUT
    /////////////////////////////////////////////////////

    logger.info("CREATING OUTPUT TEXTURE");

    OUTPUT_TEXTURE = new GLTexture(this, OUTPUT_W, OUTPUT_H);

    // a la ventana de salida yo solo le paso una textura
    // que funciona como canvas ya que luego
    // cada escena en particular me va a devolver una textura
    // de Opengl con la que puedo hacer distintas coas.
//    logger.info("CREATING OUTPUT WINDOW");
//
//    OUTPUT_WINDOW = new GLTextureWindow(this, OUTPUT_X, OUTPUT_Y, OUTPUT_W, OUTPUT_H);
//    OUTPUT_WINDOW.setTexture(OUTPUT_TEXTURE);
//    OUTPUT_WINDOW.init();
   
   
    // Loading required filters.
    logger.info("LOADING TEXTURE FILTERS");
    ns = new GLTextureFilter(this, "./data/shaders/nigth.xml");
    tex0 = new GLTexture(this, OUTPUT_W, OUTPUT_H, GLTexture.FLOAT);

   
    dream = new GLTextureFilter(this, "./data/shaders/dream.xml");
    nightShot = new GLTexture(this, OUTPUT_W, OUTPUT_H, GLTexture.FLOAT);
    ////////////////////////////////////////////////////
    // setup escene
    /////////////////////////////////////////////////////
    logger.info("CREATING ESCENE: ELASTIC GRID");
    serLiquido = new ElasticGrid( (PApplet) this, OUTPUT_W, OUTPUT_H);           
View Full Code Here

Examples of codeanticode.glgraphics.GLTexture

            scaledFaceImage.copy(faceImage, 0, 0, faceImage.width, faceImage.height,
                            0, 0, scaledFaceImage.width  , scaledFaceImage.height);
                                                //FaceImage
          //  texturePool.get(texturePool.size() - 1).putPixelsIntoTexture(faceImage, values[0], values[1], values[2], values[3]);
         
            GLTexture temp = new GLTexture(parent);
            temp.putPixelsIntoTexture(faceImage, values[0], values[1], values[2], values[3]);
            texturePool.add(temp);
           
            logger.info("texture added: " + filename);
           
         
View Full Code Here

Examples of codeanticode.glgraphics.GLTexture

    // OUTPUT
    /////////////////////////////////////////////////////

    logger.info("CREATING OUTPUT TEXTURE");

    OUTPUT_TEXTURE = new GLTexture(this, OUTPUT_W, OUTPUT_H);

    // a la ventana de salida yo solo le paso una textura
    // que funciona como canvas ya que luego
    // cada escena en particular me va a devolver una textura
    // de Opengl con la que puedo hacer distintas coas.
    //    logger.info("CREATING OUTPUT WINDOW");
    //
    //    OUTPUT_WINDOW = new GLTextureWindow(this, OUTPUT_X, OUTPUT_Y, OUTPUT_W, OUTPUT_H);
    //    OUTPUT_WINDOW.setTexture(OUTPUT_TEXTURE);
    //    OUTPUT_WINDOW.init();


    // Loading required filters.
    logger.info("LOADING TEXTURE FILTERS");
    ns = new GLTextureFilter(this, "./data/shaders/nigth.xml");
    tex0 = new GLTexture(this, OUTPUT_W, OUTPUT_H, GLTexture.FLOAT);


    dream = new GLTextureFilter(this, "./data/shaders/dream.xml");
    nightShot = new GLTexture(this, OUTPUT_W, OUTPUT_H, GLTexture.FLOAT);
    ////////////////////////////////////////////////////
    // setup escene
    /////////////////////////////////////////////////////
    logger.info("CREATING ESCENE: ELASTIC GRID");
    serLiquido = new ElasticGrid( (PApplet) this, OUTPUT_W, OUTPUT_H);           
View Full Code Here

Examples of org.mt4j.util.opengl.GLTexture

//      ts.shrinkFilter = SHRINKAGE_FILTER.Trilinear; //For better quality
      ts.expansionFilter = EXPANSION_FILTER.Bilinear;
      ts.wrappingHorizontal = WRAP_MODE.CLAMP_TO_EDGE;
      ts.wrappingVertical = WRAP_MODE.CLAMP_TO_EDGE;
    
      textureToRenderTo = new GLTexture(mtApp, ts);
//      textureToRenderTo = new MTTexture(mtApp, rectC.width, rectC.height, ts); //This would also init the gl texture
      textureToRenderTo.width = rectC.width; //So that tex coords of shape get scaled correctly
      textureToRenderTo.height = rectC.height;
     
      if (!mtApp.isRenderThreadCurrent()){
View Full Code Here

Examples of org.mt4j.util.opengl.GLTexture

    //Create the earth
    earth = new MTSphere(pa, "earth", 40, 40, 80, TextureMode.Projected); //TextureMode.Polar);
    earth.setLight(light);
    earth.setMaterial(material);
    earth.rotateX(earth.getCenterPointRelativeToParent(), -90);
    earth.setTexture(new GLTexture(pa,imagesPath + "worldMap.jpg", new GLTextureSettings(TEXTURE_TARGET.TEXTURE_2D, SHRINKAGE_FILTER.Trilinear, EXPANSION_FILTER.Bilinear, WRAP_MODE.CLAMP_TO_EDGE, WRAP_MODE.CLAMP_TO_EDGE)));
        earth.generateAndUseDisplayLists();
        earth.setPositionGlobal(new Vector3D(pa.width/2f, pa.height/2f, 250)); //earth.setPositionGlobal(new Vector3D(200, 200, 250));
        //Animate earth rotation
        new Animation("rotation animation", new MultiPurposeInterpolator(0,360, 17000, 0, 1, -1) , earth).addAnimationListener(new IAnimationListener(){
          public void processAnimationEvent(AnimationEvent ae) {
            earth.rotateY(earth.getCenterPointLocal(), ae.getCurrentStepDelta(), TransformSpace.LOCAL);
          }}).start();
       
        //Put planets in a group that can be manipulated by gestures
        //so the rotation of the planets doesent get changed by the gestures
    MTComponent group = new MTComponent(mtApplication);
    group.setComposite(true); //This makes the group "consume" all picking and gestures of the children
    group.registerInputProcessor(new DragProcessor(mtApplication));
    group.addGestureListener(DragProcessor.class, new DefaultDragAction());
    group.addGestureListener(DragProcessor.class, new InertiaDragAction(80, 0.8f, 10));
    group.registerInputProcessor(new RotateProcessor(mtApplication));
    group.addGestureListener(RotateProcessor.class, new DefaultRotateAction());
    //Scale the earth from the center. Else it might get distorted
    group.registerInputProcessor(new ScaleProcessor(mtApplication));
    group.addGestureListener(ScaleProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        ScaleEvent se = (ScaleEvent)ge;
        earth.scaleGlobal(se.getScaleFactorX(), se.getScaleFactorY(), se.getScaleFactorX(), earth.getCenterPointGlobal());
        return false;
      }
    });
    this.getCanvas().addChild(group);
        group.addChild(earth);
       
        //Create the moon
        final MTSphere moonSphere = new MTSphere(pa, "moon", 35, 35, 25, TextureMode.Polar);
         moonSphere.setMaterial(material);
        moonSphere.translate(new Vector3D(earth.getRadius() + moonSphere.getRadius() + 50, 0,0));
        moonSphere.setTexture(new GLTexture(pa, imagesPath + "moonmap1k.jpg", new GLTextureSettings(TEXTURE_TARGET.RECTANGULAR, SHRINKAGE_FILTER.Trilinear, EXPANSION_FILTER.Bilinear, WRAP_MODE.CLAMP_TO_EDGE, WRAP_MODE.CLAMP_TO_EDGE)));
        moonSphere.generateAndUseDisplayLists();
        moonSphere.unregisterAllInputProcessors();
        //Rotate the moon around the earth
        new Animation("moon animation", new MultiPurposeInterpolator(0,360, 12000, 0, 1, -1) , moonSphere).addAnimationListener(new IAnimationListener(){
          public void processAnimationEvent(AnimationEvent ae) {
View Full Code Here

Examples of org.mt4j.util.opengl.GLTexture

    this.init(p, horizontalTileCount, horizontalTileCount);
  }
 
  private void init(PImage p, int horizontalTileCount, int verticalTileCount){
    if (MT4jSettings.getInstance().isOpenGlMode() && !(p instanceof GLTexture)){
      GLTexture tex = new GLTexture(app, p);
      this.image = tex;
    }else{
      this.image = p;
    }
   
View Full Code Here

Examples of org.mt4j.util.opengl.GLTexture

      boolean textureDrawn = false;
      if (this.isTextureEnabled()
        && this.getTexture() != null
        && this.getTexture() instanceof GLTexture) //Bad for performance?
      {
        GLTexture tex = (GLTexture)this.getTexture();
        textureTarget = tex.getTextureTarget();
       
        //tells opengl which texture to reference in following calls from now on!
        //the first parameter is eigher GL.GL_TEXTURE_2D or ..1D
        gl.glEnable(textureTarget);
        gl.glBindTexture(textureTarget, tex.getTextureID());
       
        gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY);
       
        if (this.isUseVBOs()){//Texture
          gl.glBindBuffer(GL.GL_ARRAY_BUFFER, this.getGeometryInfo().getVBOTextureName());
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.